-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Browser gets a 200/OK blank page when default exception handler is registered #280
Comments
Currently raven assumes that a default error handler is set with |
It's a tricky one; I understand that the SDK should be as unobtrusive as possible and if you start modifying response headers you have to think about what happens if the script is running in a cli environment too, it should probably exit with a 1. In my use case, I'm trying to integrate this in a CodeIgniter 2.x application sigh which has no concept of exceptions or a default exception handler, hence one isn't registered already. |
@jamieburchell is it something that is easy enough for you to pass in your own handler? I'm not sure if thats the best solution, but potentially you could re-throw from there. We could also try to handle this internally in the SDK as well. |
To solve this one I've defined a default exception handler before instructing the Raven client to register its own. My handler sends a 500. I'm thinking if an exception handler hasn't already been defined the Raven client should mimic what would have happened had the client not been used, i.e send a 500 status code. I'm not sure what happens with uncaught exceptions in CLI requests but I'm guessing the exit value is non zero. |
@jamieburchell |
We are now rethrowing the exception if not other error handler was set so a 500 error will be returned as "normal". <?php
ini_set('display_errors', false);
require __DIR__ . '/lib/Raven/Autoloader.php';
Raven_Autoloader::register();
$sentry = new Raven_Client;
$sentry->install();
blablabla(); This will show a correct 500 response instead of a 200. |
Using the following code:
When an uncaught exception is caught by the
Raven_Client
, the browser receives a 200/OK response and blank page. Commenting out theregisterExceptionHandler()
line gives the expected 500/Internal Server Error response and stock browser message.Note in the scenario above, there is no existing exception handler registered.
This may be caused by the fact that the exception is actually caught, I'm looking now to see if I can find out more; it would be handy if the response was 500.
The text was updated successfully, but these errors were encountered: