Class: Grape::Middleware::Error
- Defined in:
- lib/grape/middleware/error.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ default_status: 500, default_message: '', format: :txt, rescue_all: false, rescue_grape_exceptions: false, rescue_subclasses: true, rescue_options: { backtrace: false, original_exception: false }.freeze }.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#after, #before, #call, #content_type, #content_type_for, #content_types, #context, #initialize, #mime_types, #query_params, #rack_request, #response
Methods included from DSL::Headers
Constructor Details
This class inherits a constructor from Grape::Middleware::Base
Instance Method Details
#call!(env) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/grape/middleware/error.rb', line 19 def call!(env) @env = env error_response(catch(:error) { return @app.call(@env) }) rescue Exception => e # rubocop:disable Lint/RescueException run_rescue_handler(find_handler(e.class), e, @env[Grape::Env::API_ENDPOINT]) end |