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

Rupert Germann rupi at gmx.li
Fri Oct 9 15:18:31 CEST 2009


hi again,

I simplified the patch and removed the "flashmessages to adminpanel" 
functionality.

Changes:
- Error messages are now redered to the adminpanel with 
$TT->setTSlogMessage()
- Errors and Exceptions are written to the sys_log table if a BE_USER 
object is present

With this last change the improved error and exception handling can now 
write its messages to all available logging systems in TYPO3.

And additionally PHP errors which are handled by the errorhandler and 
which are not registered as exceptional errors will not break the output 
anymore. They are displayed as flashmessages in BE and in the adminpanel 
in FE.

see screenshots.

greets
rupert



Rupert Germann schrieb:
>> hi & rfc
>>
>> here's a new approach to make the errorhandling fit for final.
>>
>> features:
>> - if display of errors is enabled and an error occurs this error is 
>> displayed as flashmessage
>> - BE error flashmessages are displayed by template.php
>> - FE error flashmessages are displayed in the adminpanel (see screenshot)
>> - to distinguish between production- and debug-mode I introduced a new 
>> constant ERRORHANDLER_MODE which depends on the configured 
>> exceptionhandler
>> - all calls to errorhandling or exceptionhandling are logged to syslog
>> to enable the syslog, add this to your localconf.php:
>> $TYPO3_CONF_VARS['SYS']['systemLog'] = 'error_log,,2';   
>> $TYPO3_CONF_VARS['SYS']['systemLogLevel'] = 0;
>>
>> - I introduced a new TYPO3_CONF_VARS parameter:
>> $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']
>>
>> this parameter configures which errors reach the errorhandler.
>>
>> $TYPO3_CONF_VARS['SYS']['exceptionalErrors'] is still used, it 
>> configures the errors which should be converted to an exception.
>>
>> So we have 2 kind of errors: errorhandler errors and exceptionsl errors.
>>
>> The default configuration looks like this:
>>
>> 'errorHandlerErrors'=> E_ALL ^ E_NOTICE,
>> 'exceptionalErrors' => E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ 
>> E_USER_NOTICE ^ E_USER_WARNING
>>
>> That means: everything but E_NOTICE reaches the errorhandler. But the 
>> errorhandler function throws only an exception on exceptional errors 
>> like e.g. E_RECOVERABLE_ERROR.
>>
>>
>> INFO:
>> this patch contains patch 12130 v5.
>>
>>
>> greets
>> rupert
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
> 



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