Re: set_exception_handler catches all Throwables
| From: | Niklas Keller | Date: | Wed, 19 Aug 2015 11:30:56 +0000 |
| Subject: | Re: set_exception_handler catches all Throwables | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87794@lists.php.net to get a copy of this message | ||
What do you guys do in the set_exception_handler callback? Wouldn't most
code just use the same callback and just log the error / exception?
Regards, Niklas
2015-08-19 11:55 GMT+02:00 Björn Larsson <bjorn.x.larsson@telia.com>:
> Den 2015-08-19 kl. 10:52, skrev Peter Cowburn:
>
>> On 17 August 2015 at 15:24, Sebastian Bergmann <sebastian@php.net> wrote:
>>
>> Am 17.08.2015 um 16:00 schrieb Derick Rethans:
>>>
>>>> Actually, I don't call this intended. This is just as much as a BC break
>>>> as the original implementation where Errors where also Exceptions. IMO,
>>>> set_exception_handler() should be changed - with my preference it not
>>>> capturing Error, and instead have an additional set_throwable_handler().
>>>>
>>> +1
>>>
>>> What's the plan for set_exception_handler() regarding Throwables? Seeing
>> as
>> we're now in the RC release phase I think this bone of contention should
>> be
>> resolved one way or another as soon as we can.
>>
> Yes, a "global" function that behaves differently between PHP 5 & 7 is not
> optimal in
> my view. I'm also wondering how to make one handler managing two
> different type
> of situations. @ircmaxwell described it in *Core functions throwing
> exceptions in PHP7*:
> "Errors signify programmer error, where Exceptions signify
> unknown or runtime errors. Meaning that an Error should always be a
> problem with your code, but an Exception could be a systems problem, a
> user problem or a problem in your code."
>
> /Cheers //Björn Larsson/
>
> PS A bit new to this list but hope to have contributed a little :)
>
>