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

Improve error reporting when custom error handler is used #290

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

clue
Copy link
Member

@clue clue commented Apr 18, 2022

This changeset improves error reporting when custom error handler is used (set_error_handler()). In particular, a global error handler may interrupt our code flow and unset the error reported to us (#286). The updated logic makes sure to set a custom error handler before invoking any functions that may report an error and restore the original error handler afterwards.

The gist is that using error_get_last() in library code is almost always broken and should be avoided: https://twitter.com/another_clue/status/1503830137132957696 and thecodingmachine/safe#332

Resolves / closes #286
Builds on top of #266, #267, #269, #168, and others
Also refs reactphp/event-loop#245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.11.0] Accessing array offset on null value - Failed TCP connection without ext-sockets
3 participants