-
Notifications
You must be signed in to change notification settings - Fork 436
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
/__better_errors not working #353
Comments
Since this has not been answered for more than 5 months, I put up a simple snippet to patch my apps thanks to @willcosgrove indications. You can use it until the issue is answered. Put the following in an initializer or in a lib file and require it on startup : module BetterErrors
class Middleware
def show_error_page(env, exception=nil)
type, content = if @error_page
if text?(env)
[ 'plain', @error_page.render('text') ]
else
[ 'html', @error_page.render ]
end
else
[ 'html', no_errors_page ]
end
[500, { "Content-Type" => "text/#{type}; charset=utf-8" }, [content]]
end
end
end |
Confirmed. |
The exception being raised is @willcosgrove thanks for opening this issue so it could be tracked down. Just want to let you know that if you had mentioned the text of the exception, it would have been much more helpful. |
Version 2.2.0 of the gem has been released, so this issue seems to be fixed. |
Ever since rails/rails@266455c the
/__better_errors
endpoint has been broken.The changes here and here make it so that instantiating an
ActionDispatch::ExceptionWrapper
with anil
in place of theexception
will result in a 💥Which is exactly what happens when you go to
/__better_errors
I don't know whether it's the fault of rails for changing the internals of
ActionDispatch::ExceptionWrapper
, or ifexception
should have always been non-nil
, in which case it's better_error's bug.What do you think @charliesome? Should I submit a PR here to fix this, or should I take this up with Rails?
The text was updated successfully, but these errors were encountered: