Re: Re: PEAR_Warning proof of concept
| From: | Greg Beaver | Date: | Sun, 11 Jul 2004 22:27:32 +0000 |
| Subject: | Re: Re: PEAR_Warning proof of concept | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31863@lists.php.net to get a copy of this message | ||
Sergio Carvalho wrote:
Alan Knowles wrote:Turns out, I have wireless internet in the hotel :) OK, an example. Say an invalid option is passed into a low-level package, and the package uses the default option instead, and raises a warning (this is fully accepted practice). If the mid-level package used by the application is more strict about what is allowed, it may want to instead raise an exception, for instance letting the user know that an invalid option was entered and so the mid-level state cannot be depended on to work. GregI wonder if having the ability to elevate warnings to exceptions may be overdesigning the class.. - Trouble is that designing something as core as the error/warning handler, you are between a rock and and hard place (or whatever the phrase is). Your dammed if you add it in and dont need it, and your dammed if you dont, and you have to break BC later.. :)Can you please provide an example of a situation where a warning would be elevated to an exception? I can easily imagine the other way around: an Exception being downgraded into a Warning, upon incomplete error recovery. For a Warning to be upgraded to an Exception, the lower library must have been throwing warnings in place of exceptions, no?