Project

General

Profile

Actions

Bug #82782

closed

Exception with 'displayErrors' => '2'

Added by Christoph Lehmann about 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2017-10-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Exception:

The option $TYPO3_CONF_VARS[SYS][displayErrors] is not set to "-1", "0" or "1". in /usr/local/share/typo3/typo3_src-8.7.8/typo3/sysext/core/Classes/Core/Bootstrap.php:654

The documentation says "2" is a valid value in https://docs.typo3.org/typo3cms/CoreApiReference/8.7/ApiOverview/ErrorAndExceptionHandling/Configuration/

The code looks like

        switch ($displayErrorsSetting) {
            case -1:
                $ipMatchesDevelopmentSystem = GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
                $exceptionHandlerClassName = $ipMatchesDevelopmentSystem ? $debugExceptionHandlerClassName : $productionExceptionHandlerClassName;
                $displayErrors = $ipMatchesDevelopmentSystem ? 1 : 0;
                $exceptionalErrors = $ipMatchesDevelopmentSystem ? $exceptionalErrors : 0;
                break;
            case 0:
                $exceptionHandlerClassName = $productionExceptionHandlerClassName;
                $displayErrors = 0;
                break;
            case 1:
                $exceptionHandlerClassName = $debugExceptionHandlerClassName;
                $displayErrors = 1;
                break;
            default:
                // Throw exception if an invalid option is set.
                throw new \RuntimeException(
                    'The option $TYPO3_CONF_VARS[SYS][displayErrors] is not set to "-1", "0" or "1".',
                    1476046290
                );
       }
@ini_set('display_errors', $displayErrors);

So the documentation should be adapted or the option should be realised...

Actions #1

Updated by Christoph Lehmann about 7 years ago

Also the documentation says display_errors is not changed when $TYPO3_CONF_VARS[SYS][displayErrors] is -1, that's wrong too

Actions #2

Updated by Christoph Lehmann about 7 years ago

  • Description updated (diff)
Actions #3

Updated by Christoph Lehmann about 7 years ago

  • Description updated (diff)
Actions #4

Updated by Benni Mack about 7 years ago

  • Status changed from New to Needs Feedback

Nope. The option "2" was removed in favor of using "-1" - we had that too in our updated projects (where LocalConfiguration was read only or added via .env variables), so this is a one-time manual process for you to update your LocalConfiguration/AdditionalConfiguration setting.

Actions #5

Updated by Christoph Lehmann about 7 years ago

  • Category set to Documentation

Okay, thank you. fixed it in my configuration.

I currently see no option to get a stack trace in production environments (with devIPMask and displayErrors = -1) while(!) hiding warnings and notices. Is there such a possibility?

Actions #6

Updated by Benni Mack almost 7 years ago

  • Status changed from Needs Feedback to Closed

Sorry for the late reply.

You need to configure that the ProductionExceptionHandler is not showing ERRORS etc, which can be configured via SYS/exceptionalErrors.

Actions #7

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Closed to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55619

Actions #8

Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55619

Actions #9

Updated by Wouter Wolters almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55620

Actions #11

Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55620

Actions #12

Updated by Wouter Wolters almost 7 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF