Re: Exceptions and Errors
| From: | Marcus Boerger | Date: | Tue, 13 Apr 2004 21:02:32 +0000 |
| Subject: | Re: Exceptions and Errors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9123@lists.php.net to get a copy of this message | ||
Hello Adam,
Tuesday, April 13, 2004, 10:52:01 PM, you wrote:
> On Tue, 13 Apr 2004, George Schlossnagle wrote:
>> > Is there a reason not to move non-continuable E_ERRORs to E_WARNINGs?
>> > This prevents us from adding another severity level and also allows us
>> > to make all E_ERRORs fatal in the process.
>>
>> This is a huge bc break. Raising the severity on non-continuable
>> errors and throwing exceptions for E_ERRORs produces no bc issues.
> I'm confused about the warning levels. I guess it's best if I talk
> this out in an e-mail. :)
> In PHP 4, E_ERROR is fatal. In PHP 5, E_ERROR is (currently) also
> fatal. This always happens regardless of any exception handling.
> With exceptions, we have the ability to modify E_ERRORs to be
> non-fatal.
Not at the moment.
> However, even with exceptions, some errors should still be
> considered fatal.
> We have some choices:
> 1) Promote those few "truly fatal" errors to something else, like
> E_FATAL. Current E_ERRORs remain fatal, unless (now) caught by a
> catch() block.
> 2) Demote "recoverable E_ERRORS" to E_WARNING. Things that are E_ERROR
> are always fatal regardless of exception handling.
> 3) Something else, yet to be proposed.
> I guess I'm confused about why some E_ERRORs are now able to be
> handled in userland, but only by using exceptions. If these types of
> errors are now recoverable, shouldn't we let the programmer decide how
> they want to handle them?
> -adam
> --
> adam@trachtenberg.com
> author of o'reilly's php cookbook
> avoid the holiday rush, buy your copy today!
--
Best regards,
Marcus mailto:helly@php.net