-
Notifications
You must be signed in to change notification settings - Fork 78
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
Bugsnag exception handler causes CLI scripts to exit 0 with uncaught exceptions #523
Comments
I have the same issue, this has now bitten me multiple times. |
Hi @glennpratt, have you tried using the workaround in @blkperl's issue report using |
Yes @xander-jones thanks. I have read all the issues, though the contention that this is normal behavior is rather off to me. I've been working with PHP for a very long time and maintaining sane behavior when settings these handlers has always seemed a given to me. Here's yesterdays banging my head against a wall and implementing this in another project: // Workaround https://github.com/bugsnag/bugsnag-php/issues/523 which causes all PHP
// exceptions to be swallowed and exit 0.
$previousHandler = null;
$previousHandler = set_exception_handler(function ($throwable) use (&$previousHandler): void {
if ($previousHandler !== null) {
call_user_func($previousHandler, $throwable);
}
throw $throwable;
});
Bugsnag\Handler::registerWithPrevious(self::$bugsnagClient); |
This should now be fixed in v3.23.1 |
Thanks @imjoehaines! |
Description
Bugsnag exception handler causes CLI scripts to exit 0 with uncaught exceptions
Issue
Bugsnag exception handler causes CLI scripts to exit 0 with uncaught exceptions
Environment
Example code snippet
How to reproduce the issue
How to workaround the issue
The text was updated successfully, but these errors were encountered: