Re: RFC: Replacing errors with Exceptions
| From: | Richard Lynch | Date: | Mon, 27 Jul 2009 02:44:16 +0000 |
| Subject: | Re: RFC: Replacing errors with Exceptions | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45101@lists.php.net to get a copy of this message | ||
On Fri, July 24, 2009 9:35 am, Alexey Zakhlestin wrote:
> On Fri, Jul 24, 2009 at 6:29 PM, Hannes
> Magnusson<hannes.magnusson@gmail.com> wrote:
>> On Fri, Jul 24, 2009 at 15:43, Ben Scholzen
>> 'DASPRiD'<mail@dasprids.de> wrote:
>>> To you both, this is especially, for library code like Zend
>>> Framework.
>>> The library cannot expect the user to have the error handle set, so
>>> it
>>> would have to replace the error handler before every line which it
>>> wants
>>> to try {} and reset it after the catch. This is not really a clean
>>> solution, at it can occur pretty often.
>>
>> Why do you have to replace it?
>
> because in case of a library, there is a "third-party" called "user".
> User might have his own opinion on error-handlers. And then, there's
> even worse case, when there are 2 or three libraries mixed in the
> single project
Construct your error-handler to "stack" nicely and throw or
trigger_error whatever would have happened without it.
Then you need not unset/reset the silly thing.
--
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch