Starting with Rails 5.0.2 (or possibly earlier) ActionDispatch::ExceptionWrapper will raise an exception undefined method 'cause' for nil:NilClass if a nil exception is passed to it. This is always done when the "manual" page is presented, when the user requests the /__better_errors page. This is the issue in #353.
On Better Errors' "manual" console page, it's not necessary to try to copy the status code from the exception anyway, that only needs to be done when Better Errors is returning an error response caused by the exception.
This fixes the issue by checking for a nil exception and skipping the use of ActionDispatch::ExceptionWrapper in only that case.
Starting with Rails 5.0.2 (or possibly earlier)
ActionDispatch::ExceptionWrapper
will raise an exceptionundefined method 'cause' for nil:NilClass
if a nil exception is passed to it. This is always done when the "manual" page is presented, when the user requests the/__better_errors
page. This is the issue in #353.On Better Errors' "manual" console page, it's not necessary to try to copy the status code from the exception anyway, that only needs to be done when Better Errors is returning an error response caused by the exception.
This fixes the issue by checking for a nil exception and skipping the use of
ActionDispatch::ExceptionWrapper
in only that case.