Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ErrorHandler::handleError signature: make $context nullable #1614

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

koenkivits
Copy link
Contributor

@koenkivits koenkivits commented Nov 25, 2021

Even though the PHP docs don't mention it, the error context can be null. We just experienced this with a failing getaddrinfo call from an internal PHP function during shutdown, which triggered a warning, which in turn crashed the Monolog error handler.

A more in-depth explanation for this fix can be found in the Sentry repo, where the same problem was fixed a while back: getsentry/sentry-php#912 (comment)
Note that this is only relevant for PHP<=7, as the context parameter has been removed in PHP8.

Thanks in advance!

The context can be null, eg. for internal PHP errors.
@Seldaek Seldaek added this to the 2.x milestone Mar 6, 2022
@Seldaek Seldaek added the Bug label Mar 6, 2022
@Seldaek Seldaek merged commit 16cc886 into Seldaek:main Mar 7, 2022
@Seldaek
Copy link
Owner

Seldaek commented Mar 7, 2022

Thanks

@lyrixx lyrixx mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants