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

Easier userland 500 error views #17586

Closed
ockle opened this issue Jan 26, 2017 · 2 comments
Closed

Easier userland 500 error views #17586

ockle opened this issue Jan 26, 2017 · 2 comments

Comments

@ockle
Copy link
Contributor

ockle commented Jan 26, 2017

Currently, anything that causes a 500 error results in a "Whoops, looks like something went wrong" error page. Although ideally a user would never see this error, mistakes can happen, and in that event, it is nice to have an appropriately styled error view ready, just in case.
However, getting Laravel to display the custom 500 view takes more work than one expects - dropping a 500 view in the errors directory does not cut it. Here are two discussions on how to achieve the desired effect: one, two.

I feel that having to override methods in order to get a custom 500 view is not user friendly, and instead would propose the following behavior:

  • If debug is enabled, always show the full error/stack trace.
  • If debug disabled and errors/500 view present, show that.
  • If debug disabled and no errors/500 view present, show existing "Whoops, looks like something went wrong" page.
@GrahamCampbell
Copy link
Member

Everyone has a different idea for what they want with error handling. I suggest you just implement what you want in your app. :)

I have an opinionated exceptions package if you're interested in checking that out.

@ockle
Copy link
Contributor Author

ockle commented Jan 26, 2017

@GrahamCampbell I understand that, and if it were even a case of being able to fully handle it in the render() method on the Handler, like other exceptions, I would completely agree. But to properly achieve it, you have to override methods and potentially then call parent::, which feels a bit awkward.
I guess when I come across something that needs to be done in an inconsistent or non-Laravel-y way, I figure its always worth at least opening a dialog on improving it :)
Looking at your exceptions package, it clearly very powerful, and I'll keep it in mind if I need more power in future, but it's probably overkill to just get a custom 500 error view :)

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

No branches or pull requests

2 participants