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

Nice error page in debug mode #106

Open
szabgab opened this issue May 23, 2017 · 4 comments
Open

Nice error page in debug mode #106

szabgab opened this issue May 23, 2017 · 4 comments

Comments

@szabgab
Copy link
Member

szabgab commented May 23, 2017

It would be nice if Bailador would catch any exceptions during its processing and instead of "Internal Server Error" it would give a nice error page. (e.g. like Flask does)

szabgab added a commit that referenced this issue May 24, 2017
@ufobat
Copy link
Member

ufobat commented May 25, 2017

what do you think of the idea that the error page could be a template as well. all we need to do is ship a "hardcoded" 500.debug template.

there would be 4 different cases

  • debug mode == 1 and no $!location/views/500.debug available
  • debug mode == 1 and a 500.debug is avilable (so somone could still create his own default error page
  • debug mode == 0 and no 500.xx => still the Inernal server error
  • debug mode == 0 and a 500.xx evailable => template should be used

@szabgab
Copy link
Member Author

szabgab commented May 25, 2017

I am working on a template for the 500 page. I am not sure what would we want to show in debug mode if there is a user-created 500 template. Actually I am not even sure we want to stay with a simple template for 500 errors. Flask for example allows you to create a "virtual route" which is called in case there is a 500 error. That way the developer can do more than just show a plain page.

szabgab added a commit that referenced this issue May 25, 2017
embedded template to show 500 error messages in debug mode. #106
@JJ
Copy link
Contributor

JJ commented Dec 2, 2017

Wouldn't it be better if this was an external file, instead of hard-coding it? Better user configuration, too.

@ufobat
Copy link
Member

ufobat commented Dec 4, 2017

I agree with you, what is hardcoded could/should probably be in the resources. This is the last resort, if there are error templates in your application, I think they're named 500.xx, you would use them. So from the configuration/usability perspective I'd say it is okay. no?

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

3 participants