Class: EIVO::ApplicationController

Inherits:
ActionController::API
  • Object
show all
Includes:
Concerns::Exception, Concerns::Rendering
Defined in:
app/controllers/eivo/application_controller.rb

Direct Known Subclasses

ApplicationController, StatusController

Instance Method Summary collapse

Methods included from Concerns::Rendering

#render_error, #render_errors, #render_forbidden, #render_internal_server_error, #render_model_errors, #render_not_found, #render_parameter_missing, #render_success, #render_unauthorized

Methods included from Concerns::Exception

#set_exception_context

Instance Method Details

#process_action(*args) ⇒ Object

doesn’t work rescue_from ::ActiveRecord::RecordNotFound, with: :render_not_found rescue_from ::ActionController::ParameterMissing, with: :render_parameter_missing rescue_from ::StandardError, with: :render_internal_server_error



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/eivo/application_controller.rb', line 13

def process_action(*args)
  begin
    super
  rescue ::ActiveRecord::RecordNotFound => e
    render_not_found(e)
  rescue ::ActionController::ParameterMissing => e
    render_parameter_missing(e)
  rescue ::StandardError => e
    if Rails.env.development? || Rails.env.test?
      raise e
    else
      ::Raven.capture_exception(e)
    end

    render_internal_server_error(e)
  end
end