Review main Merged

59287[TASK] Handle configured error level only in error handler

Christoph Lehmann CR +2 V +2 Normal +97 −4 updated 04/05/19, 15:09

Commit message

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.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Mona Muzaffar +1
    • Jigal van Hemert +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Mona Muzaffar +1
    • Jigal van Hemert +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2534

Show 69 earlier messages
  1. Christoph Lehmann uploaded patch set 1 12/23/18, 14:19

  2. Christoph Lehmann uploaded patch set 2 12/23/18, 14:22

  3. TYPO3com voted on patch set 1 V +1 12/23/18, 14:32 Completed build in 12m 20s on Sun, 23 Dec, 03:32 PM Test Summary: 47813 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31125

  4. TYPO3com voted on patch set 2 V +1 12/23/18, 14:35 Completed build in 11m 51s on Sun, 23 Dec, 03:35 PM Test Summary: 47813 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31126

  5. Christoph Lehmann updated the commit message in patch set 3 12/23/18, 15:35

  6. TYPO3com voted on patch set 3 V +1 12/23/18, 15:45 Completed build in 09m 43s on Sun, 23 Dec, 04:45 PM Test Summary: 47813 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31127

  7. Kai Möller commented on patch set 3 CR -1 01/14/19, 13:03

    ErrorHandler.php:107

    I suggest using a variable for this condition. You could use $shouldHandleError = $this->errorHandlerErrors & $errorLevel; if (error_reporting() === 0 || !$shouldHandleError { ... }
  8. Christoph Lehmann commented on patch set 4 01/14/19, 13:21

    Published edit on patch set 3.
  9. Kai Möller voted on patch set 4 V +1 CR +1 01/14/19, 13:23

  1. TYPO3com voted on patch set 4 V +1 01/14/19, 13:35 Completed build in 13m 34s on Mon, 14 Jan, 02:35 PM Test Summary: 47584 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31488

  2. Benni Mack updated the commit message in patch set 5 01/15/19, 05:23

  3. TYPO3com voted on patch set 5 V +1 01/15/19, 05:35 Completed build in 11m 25s on Tue, 15 Jan, 06:35 AM Test Summary: 47584 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31498

  4. Alexander Schnitzler commented on patch set 5 01/15/19, 10:13

    Hi Christoph, can you please explain how the error handler of the sentry package forwards the errors to the core error handler? If I read the php docs correctly you register an error handler via set_error_handler and once you register more, you stack them and you can remove handlers from the stack with restore_error_handler. I am unsure though how the forwarding then happens as the core error handler is already created with a specific $errorHandlerErrors value before the extension puts it's own error handler on top. I am asking because this use case should get a functional test and while trying to understand this issue I also tried to come up with a test. A generic one, without the sentry package but with mocks instead.
  5. Christoph Lehmann commented on patch set 5 01/15/19, 10:26

    Hi Alex, the forwarding is done in https://github.com/getsentry/sentry-php/blob/1.10.0/lib/Raven/Breadcrumbs/ErrorHandler.php#L33 The registration of a new error handler is done in https://github.com/getsentry/sentry-php/blob/1.10.0/lib/Raven/Breadcrumbs/ErrorHandler.php#L40 "Problem" here is the E_ALL, but there is no way to get the previously registered error level, because set_error_handler() does not return it. So every error is forwarded.
  6. Alexander Schnitzler commented on patch set 5 01/15/19, 10:46

    Sorry but I still don't get how the E_ALL affects the core error handler. The sentry error handler is registered with E_ALL but the core error handler still has its registered error level. So, how does the other affect the core error handler and what is the overall goal here? I might be totally blind but I really don't see what this patch tries to accomplish.
  7. Alexander Schnitzler commented on patch set 5 01/15/19, 10:55

    Nevermind, I got it... I will push a functional test for this case soon.
  8. Christoph Lehmann commented on patch set 5 01/15/19, 10:56

    Hi Alex, thank you very much for your investigation, and the functional test :-)
  9. Alexander Schnitzler uploaded patch set 6 01/15/19, 11:47

  10. Alexander Schnitzler uploaded patch set 7 01/15/19, 11:53

  11. TYPO3com voted on patch set 6 V -1 01/15/19, 12:03 Completed build in 15m 28s on Tue, 15 Jan, 01:03 PM Test Summary: 1 of 47980 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31503

  12. TYPO3com voted on patch set 7 V +1 01/15/19, 12:07 Completed build in 13m 39s on Tue, 15 Jan, 01:07 PM Test Summary: 47586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31505

  13. TYPO3com commented on patch set 7 01/15/19, 12:18 Completed build in 13m 50s on Tue, 15 Jan, 01:18 PM Test Summary: 47586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31507

  14. Alexander Schnitzler voted on patch set 7 V +1 CR +1 01/15/19, 13:17

  15. Kai Möller voted on patch set 7 V +1 CR +1 02/07/19, 09:43

  16. Anja Leichsenring commented on patch set 7 CR -1 02/17/19, 10:03

    I will check the need for a backport to 8.7.
  17. Christoph Lehmann commented on patch set 7 03/11/19, 19:40

    And..Can we backport it? :-)
  18. Anja Leichsenring commented on patch set 7 03/29/19, 08:48

    no. neither security relevant nor critical. So v9 and master only, please.
  19. Christoph Lehmann updated the commit message in patch set 8 03/29/19, 09:54

  20. TYPO3com voted on patch set 8 V +1 03/29/19, 10:09 Completed build in 15m 27s on Fri, 29 Mar, 11:09 AM Test Summary: 47259 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33006

  21. Anja Leichsenring voted on patch set 8 V +1 CR +1 03/30/19, 11:32

  22. Jigal van Hemert voted on patch set 8 V +1 CR +1 03/30/19, 13:14

  23. Mona Muzaffar voted on patch set 8 V +1 CR +1 04/05/19, 12:30

  24. Anja Leichsenring voted on patch set 8 V +2 CR +2 04/05/19, 15:09

  25. Anja Leichsenring merged patch set 9 04/05/19, 15:09