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

GitHub Issue #72: status 200 when using set_exception_handler #143

Merged

Conversation

ArturMoczulski
Copy link
Contributor

This changes the exception handler to trigger logging with Rollbar and follow with the default PHP global exception handler instead of overriding it. This effectively brings back the default PHP behavior for uncaught exceptions which is:

if (php_ini.display_errors == 1) {
    show error info
    HTTP RESPONSE CODE 200
} else {
    HTTP RESPONSE CODE 500
}

…er causes HTTP rc 500 on display_errors=0 by default; just have to restore it after logging with Rollbar
@rokob
Copy link
Contributor

rokob commented May 4, 2017

This seems like a straight forward change, will this break any existing code? It seems like we went from catching and handling errors to now throwing an exception.

@ArturMoczulski
Copy link
Contributor Author

@rokob That's a good question. Theoretically, it might "break" some existing code. By "break" I mean we are not going to hide exceptions anymore. The thing is, those would be exceptions that were there already. Now we change a blank page with a 200 response code into a 500 response code or a standard verbose PHP error. I would say this is not "breaking" existing code, because a blank page with a 200 response code is just as broken as a 500 response code imho. Unless I'm missing something here of course.

@ArturMoczulski
Copy link
Contributor Author

What this does is bringing back the default PHP behavior + Rollbar logging as opposed to mask errors as blank 200 rc's.

@rokob
Copy link
Contributor

rokob commented May 4, 2017

Okay right that is what I thought was happening. Merging this then.

@rokob rokob merged commit 0ceb74f into rollbar:master May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants