exception_handler icon indicating copy to clipboard operation
exception_handler copied to clipboard

Undefined method `save'

Open dkobia opened this issue 6 years ago • 6 comments

Running into the following error with db: true

Error during failsafe response: undefined method `save' for #<ExceptionHandler::Exception:0x007fb5300baa30>
  .../exceptions_controller.rb:21:in `block in <class:ExceptionsController>'

Line 21:

before_action { @exception.save if @exception.valid? && ExceptionHandler.config.try(:db) }

dkobia avatar May 25 '18 10:05 dkobia

Thanks - will fix this now.

richpeck avatar May 25 '18 10:05 richpeck

Thanks @richpeck. Additionally it didn't seem that 404s were being saved to the DB?

dkobia avatar May 25 '18 10:05 dkobia

Do they show in the browser?

richpeck avatar May 25 '18 10:05 richpeck

They do. Everything else works.

dkobia avatar May 25 '18 10:05 dkobia

Thanks - will look at this further. Did you see if 500 errors get saved?

richpeck avatar May 25 '18 11:05 richpeck

The 500 errors do get saved, except I mostly run into the Undefined method `save' issue.

If a page is not found I'm throwing a 404 with:

raise ActionController::RoutingError.new('Not Found')

This does not get saved. However the 404 page is displayed.

dkobia avatar May 25 '18 14:05 dkobia