exception_handler icon indicating copy to clipboard operation
exception_handler copied to clipboard

Phusion Passenger Support

Open dwood-somniainc opened this issue 4 years ago • 2 comments

I'm having a weird issue where its forcing a redirect to "500 Internal Server Error" default page, instead of the exception_handler show action for the not found error. The views work in development, but they don't work in production. The gem is not forcing a redirect for some odd reason.

I placed the exception config in all environment.rb files to see if that was the problem.

config.exception_handler = {
   dev: nil,
   email: "[email protected]",
   exceptions: { :all => { layout: "exception"},
                        400 => { layout: "exception"},
                        500 => { layout: "exception"}
   }
}

dwood-somniainc avatar Oct 15 '19 19:10 dwood-somniainc

Hi there, many thanks for using the gem!

I use it live in production using Passenger, so I know it works 100%. Do you have a repo I could look at -- there may be some override or something preventing the gem from firing?

richpeck avatar Oct 17 '19 07:10 richpeck

Here is the output of my log for the response that I receive.

Started GET "/ok" for 00.33.00.000 at 2019-
ActionController::RoutingError (No route matches
actionpack (5.2.3) lib/action_dispatch/middleware
actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb `process_request..
Processing by ExceptionHandler::ExceptionsController
Rendering exception_handler/mailers/new_exception
Rendered exception_handler/mailers/new_exception
Exception Sent To -> [email protected]
ExceptionHandler::ExceptionMailer#wew_exception

The exception mailer is firing off, but the exception views are not rendering for 404/500 pages with exception_handler overrides. Is there anything that I should be looking at, in terms of config files? Phusion/Nginx?

dwood-somniainc avatar Oct 17 '19 13:10 dwood-somniainc