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

Errors returned to geckoboard are always 500 errors #7

Open
iainbeeston opened this issue Jan 23, 2013 · 1 comment
Open

Errors returned to geckoboard are always 500 errors #7

iainbeeston opened this issue Jan 23, 2013 · 1 comment

Comments

@iainbeeston
Copy link

When an error is raised in the chameleon controller, raise is used with a string, which never gets caught and leads to a 500 error and (by default) rails will return a html error page of some sort, which geckoboard cannot understand. Geckoboard then shows the user the error "Sorry, server error", which makes it difficult to know what has gone wrong.

In the geckoboard documentation it's possible to return an xml document on 403, 404 and 500 errors, that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <error>Access denied.</error>
</root>

Which (I believe) geckoboard can understand and give a human-readable answer to the end user, when combined with the appropriate status code.

@iainbeeston
Copy link
Author

I think this could be solved by adding an error template, and rendering it instead of raising errors (with 403 status for auth error, 404 for template not found). Any uncaught errors could be caught using rescue_from and then rendered with a 500 status code.

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

1 participant