[TYPO3-project-4-3] improve the errorhandling

Rupert Germann rupi at gmx.li
Fri Oct 2 13:49:47 CEST 2009


hi masi,

Martin Kutschker schrieb:
> Rupert Germann schrieb:
>> 'errorHandlerErrors'=> E_ALL ^ E_NOTICE,
>> 'exceptionalErrors' => E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^
>> E_USER_NOTICE ^ E_USER_WARNING
> 
> Which errors generate now exceptions? To me it look likes that only the special warnings remain:
> 
> E_CORE_WARNING
> E_COMPILE_WARNING
> E_DEPRECATED
> E_USER_DEPRECATED

according to php manual some of these error don't reach the error_handler:
"The following error types cannot be handled with a user defined 
function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, 
E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the 
file where set_error_handler() is called. "

so currently only E_RECOVERABLE_ERROR (E_USER_DEPRECATED is new in php 
5.3) is registered as exceptional error. But that is configurable.

> BTW, what is the purpose of turning errors into exceptions?

there's no real reason. In the current state it's handy to have the very 
informative error stack view from the eception handler but this view 
could also be ported to the error handler.

>> So I changed the functions pushFlashMessage/popFlashMessages in
>> template.php to use $GLOBALS['T3_VAR']['flashmessages'] instead of
>> storing the message in the db (all should work as before)
>> the patch contains this changes, too, but they will be a separate RFC of
>> course.
> 
> Small note: a (static) member of a class would be nicer than the bad old global var stuff.

yes, good idea. I remember we had this point already when flashmessages 
where introduced. Simply collecting all message in the flashmessages 
object would do the trick.

greets
rupert


More information about the TYPO3-project-4-3 mailing list