-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Update custom errors info #3165
Conversation
It is only instances of |
Thanks @taylorotwell - I was thinking of doing a PR for something like this - but given the other issues were closed - I wasnt sure you'd be open to it. I'll submit something for 5.5 and let me know what you think...? |
I think it could raise a variety of other issues to do it. Does your custom 500 page contain a "debug" mode that contains the stack trace? If it doesn't, people will make custom 500 pages and complain they can't see the stack trace of the error. |
You can do something like (pseudocode)
That keeps current behaviour in development (for stack traces), and lets you override the |
Yeah something like that might be reasonable. |
@taylorotwell @lioannou Here is my solution I posted about on Laracasts Override the convertExceptionToResponse function. Why? Because it gets called in the renderHttpException function if there is not a view for the error. I.E. No 404.blade.php file if a 404 error is thrown. It also seems to be the "catch all" function if the error is not a validation error, http error, etc.
This would override the function found in \Illuminate\Foundation\Exceptions\Handler I also found the 500 internal error vs the 500 http error confusing. This was the best I came up with. |
sorry to highjack this a little bit, but I've always thought it would be great if the HTTP exceptions could be sent through the normal routing. This way you could have something like an public function 404()
public function 500()
etc IMHO this would make the error handling a little more consistent with normal operation. |
So the docs are not explicitly obvious that a 500 error due to an internal server issue will still cause a "whoops" page to be displayed, even if you have a custom "500.blade.php" in your errors folder.
Personally I think it would make much more sense to just allow all 500 errors to be displayed as a custom page (because if you if set a 500 error view - that is what you expect to be displayed). But there are multiple issues that have suggested this that have been closed:
laravel/framework#17586
laravel/framework#14137
laravel/framework#10466
So this PR just updates the docs to make it a bit more obvious...