Task #87281

Errorhandler handles errors without verifying the configured error level

Added by Christoph Lehmann 8 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-12-23
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

I track errors with Sentry (getsentry.io) and the extension https://extensions.typo3.org/extension/sentry_client/ which uses https://github.com/getsentry/sentry-php

Its error handler is registered with E_ALL to get every error. That is nice, because Exceptions are enriched with additional informations.

When an error occurs it does its own handling and then forwards the error to \TYPO3\CMS\Core\Error\ErrorHandler. This is nice, because TYPO3 should do it normal error handling (Show error page, flashmessages, logging, etc.)

Currently there is no easy way to get the error level of an earlier instantiated error handler (See https://bugs.php.net/bug.php?id=54033)

So what Sentrys error handler does it to forward every error (even E_NOTICE) to \TYPO3\CMS\Core\Error\ErrorHandler and there every error is handled (Logging + Flashmessages).

A standard page in TYPO3

page = PAGE
page.10 = TEXT
page.10.value = Hello World

fires a lot of PHP notices resulting in 30ms+ for the code in \TYPO3\CMS\Core\Error\ErrorHandler::handleError which is not needed.

The shortest way to correct it is to check the configured error level in \TYPO3\CMS\Core\Error\ErrorHandler before handling an error

Associated revisions

Revision 5913f4d9 (diff)
Added by Christoph Lehmann 4 months ago

[TASK] Handle configured error level only in error handler

Currently there is no way to determine the error level of a previously
registered error handler.

The commit helps chaining error handlers and prevents unnecessary extra
work.

Resolves: #87281
Releases: master, 9.5
Change-Id: Ib6cc32eeb4714cae1dd16aa5382683c374615d38
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59287
Tested-by: TYPO3com <>
Tested-by: Jigal van Hemert <>
Tested-by: Mona Muzaffar <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Jigal van Hemert <>
Reviewed-by: Mona Muzaffar <>
Reviewed-by: Anja Leichsenring <>

Revision ce8f872d (diff)
Added by Christoph Lehmann 4 months ago

[TASK] Handle configured error level only in error handler

Currently there is no way to determine the error level of a previously
registered error handler.

The commit helps chaining error handlers and prevents unnecessary extra
work.

Resolves: #87281
Releases: master, 9.5
Change-Id: Ib6cc32eeb4714cae1dd16aa5382683c374615d38
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60401
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 8 months ago

  • Status changed from New 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/59287

#2 Updated by Gerrit Code Review 8 months 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/59287

#3 Updated by Gerrit Code Review 8 months ago

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

#4 Updated by Gerrit Code Review 7 months ago

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

#5 Updated by Gerrit Code Review 7 months ago

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

#6 Updated by Gerrit Code Review 7 months ago

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

#7 Updated by Gerrit Code Review 7 months ago

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

#8 Updated by Gerrit Code Review 5 months ago

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

#9 Updated by Gerrit Code Review 4 months ago

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

#10 Updated by Christoph Lehmann 4 months ago

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

#11 Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF