Class: GraphqlRails::Controller::HandleControllerError

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_rails/controller/handle_controller_error.rb

Overview

runs before/around/after_action controller hooks

Instance Method Summary collapse

Constructor Details

#initialize(error:, controller:) ⇒ HandleControllerError

Returns a new instance of HandleControllerError.



7
8
9
10
# File 'lib/graphql_rails/controller/handle_controller_error.rb', line 7

def initialize(error:, controller:)
  @error = error
  @controller = controller
end

Instance Method Details

#callObject



12
13
14
15
16
# File 'lib/graphql_rails/controller/handle_controller_error.rb', line 12

def call
  return custom_handle_error if custom_handle_error?

  render_unhandled_error(error)
end