[TYPO3-project-4-3] improve the errorhandling
Rupert Germann
rupi at gmx.li
Thu Oct 1 21:31:08 CEST 2009
hi,
here's a first patch for a better usable error handling using flashmessages.
(see screenshots)
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.
All non-exception errors are not printed directly but they are collected
in an global array $GLOBALS['T3_VAR']['flashmessages'].
This happen in FE and BE.
During this I discovered that the current flashmessage handling is not
very scalable because every "pushed" flasmessage causes a db
select/insert operation which is incredibly slow if you have lot of
these messages.
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.
to test this I made a little extension providing a be module and a fe
plugin which can produce errors and exceptions. This extension is
attached to this post.
Comments?
greets
rupert
More information about the TYPO3-project-4-3
mailing list