Bug #66797

Can not use other classes for exception handling

Added by Eike Starkmann over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2015-05-05
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

i'm trying to use other classes for exception handling and i found this three settings:

$TYPO3_CONF_VARS['SYS']['errorHandler'] = '\Testen\Errbit\Error\ErrorHandler';
$TYPO3_CONF_VARS['SYS']['productionExceptionHandler'] = '\Testen\Errbit\Error\ProductionExceptionHandler';
$TYPO3_CONF_VARS['SYS']['debugExceptionHandler'] = '\Testen\Errbit\Error\DebugExceptionHandler';

I set them in the ext_localconf of my extension.
In backend the new classes are shown correctly under configuration, but when i produce an error the old classes are used.

Can this be a race condition, that the new configuration is is not loaded at that time?

When i set the new classes manually in LocalConfiguration.php everything works as expected.

Anyway i feel that extending the exception handling is not working like described here:
http://docs.typo3.org/typo3cms/CoreApiReference/ErrorAndExceptionHandling/Configuration/Extending/Index.html

History

#1 Updated by Wouter Wolters over 4 years ago

  • Status changed from New to Needs Feedback

Can you try it with $GLOBALS['TYPO3_CONF_VARS'] instead of $TYPO_CONF_VARS?

Furthermore you can try: $GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandler'] = 'Testen\\Errbit\\Error\\ErrorHandler';

#2 Updated by Eike Starkmann over 4 years ago

Both tried both not working.

Tried in ext_tables and ext_localconf.

#3 Updated by Wouter Wolters over 4 years ago

You cleared the system caches?

Otherwise you can debug the incoming values in typo3/sysext/core/Classes/Core/Bootstrap.php function configureExceptionHandling

#4 Updated by Eike Starkmann over 4 years ago

Yes, i used "Clear all cache" of the install tool.

I already debugged this function the incoming values are the default ones at that moment the error is thrown.

#5 Updated by Helmut Hummel over 4 years ago

Hi!

Eike Starkmann wrote:

I set them in the ext_localconf of my extension.
In backend the new classes are shown correctly under configuration, but when i produce an error the old classes are used.
Can this be a race condition, that the new configuration is is not loaded at that time?

The question is when the error occurs. If the error occurs very early in the bootstrap, TYPO3 has not read ext_localconf.php files yet, thus your config will not be used (because it cannot)

When i set the new classes manually in LocalConfiguration.php everything works as expected.

What is wrong with just doing so?

Anyway i feel that extending the exception handling is not working like described here:
http://docs.typo3.org/typo3cms/CoreApiReference/ErrorAndExceptionHandling/Configuration/Extending/Index.html

Nothing written there mentions ext_localconf.php What exactly isn't working for you what is described there?

#6 Updated by Helmut Hummel over 4 years ago

btw. To avoid such confusion, we will remove support to exchange the error handler in a different place than LocalConfiguration or AdditionalConfiguration

#7 Updated by Riccardo De Contardi about 4 years ago

  • Status changed from Needs Feedback to Closed

This is closed because these settings are only supported inside LocalConfiguration.php and AdditionalConfiguration.php

Also available in: Atom PDF