Module: JSONAPIErrors::Rails::Controller

Extended by:
ActiveSupport::Concern
Defined in:
lib/jsonapi_errors/rails/controller.rb

Instance Method Summary collapse

Instance Method Details

#render_error(exception) ⇒ Object

TODO set option to only and except for when using rescue_from



12
13
14
15
# File 'lib/jsonapi_errors/rails/controller.rb', line 12

def render_error(exception)
  response_h = HashRenderer.new(exception).render
  render json: response_h, status: response_h[:status].to_i
end