Module: Onsi::ErrorResponderBase
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/onsi/error_responder.rb
Overview
Handles default errors without StandardError
Error handled by default:
-
ActiveRecord::RecordNotFound
-
ActiveRecord::RecordInvalid
-
ActionController::ParameterMissing
Instance Method Summary collapse
-
#notify_unhandled_exception(exception) ⇒ Object
Can be overriden to report an un-handled exception to your error service of choice.
-
#render_error(response) ⇒ Object
Render an API error response.
Instance Method Details
#notify_unhandled_exception(exception) ⇒ Object
Can be overriden to report an un-handled exception to your error service of choice.
64 65 66 |
# File 'lib/onsi/error_responder.rb', line 64 def notify_unhandled_exception(exception) Rails.logger.error "Unhandled Exception `#{exception.class.name}: #{exception.message}`" end |
#render_error(response) ⇒ Object
Render an API error response.
43 44 45 |
# File 'lib/onsi/error_responder.rb', line 43 def render_error(response) render(response.renderable) end |