[TYPO3-dev] Exceptions
Steffen Kamper
info at sk-typo3.de
Mon Aug 18 12:25:47 CEST 2008
Dmitry Dulepov [typo3] schrieb:
> Hi!
>
> Steffen Kamper wrote:
>> Ingo started in core with Exceptions. Now while reading documentation
>> i found this piece of code in examples that vonverts php notices and
>> errors to exceptions:
>>
>> set_error_handler(create_function('$x, $y', 'throw new Exception($y,
>> $x);'), E_ALL & ~E_NOTICE);
>>
>> Because core throws many Notices, this may help to created a good
>> exception handler which isn't done yet.
>
> Exceptions is a good thing. But I'd like to see benefits of having this
> handler. I am not against it, I simply want to see purpose before it is
> made :) You know, every feature should have some kind of idea behind it
> :) So, benefits are:
> 1. ....
> 2. ....
>
> I definitely see this handler as central function with a way to call
> user functions inside. Logging extensions is a good candidate for
> hooking into exception handler. So it should be a bit more sophisticated
> than create_function ;)
>
Hi Dmitry,
i threw this only in empty room to start a discussion and create the
"idea". I would like to hear the idea for exceptions in core generally.
Throwing exceptions is one thing, reacting on exceptions is the next.
So the question is, should there be implemented a general exception
class in core for reactions, are there existing prototypes a.s.o.
The line i found would be kind of completition to include Errors and
Notices from php, may be for analysis or still as a pipe to react at a
central point.
vg Steffen
More information about the TYPO3-dev
mailing list