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.
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 https://github.com/thecodingmachine/safe/issues/332Resolves / closes #286 Builds on top of #266, #267, #269, #168, and others Also refs https://github.com/reactphp/event-loop/pull/245