Class: GraphqlRails::CustomExecutionError
- Inherits:
-
ExecutionError
- Object
- GraphQL::ExecutionError
- ExecutionError
- GraphqlRails::CustomExecutionError
- Defined in:
- lib/graphql_rails/errors/custom_execution_error.rb
Overview
base class which is returned in case something bad happens. Contains all error rendering structure
Instance Attribute Summary collapse
-
#extra_graphql_data ⇒ Object
readonly
Returns the value of attribute extra_graphql_data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, extra_graphql_data = {}) ⇒ CustomExecutionError
constructor
A new instance of CustomExecutionError.
- #to_h ⇒ Object
Constructor Details
#initialize(message, extra_graphql_data = {}) ⇒ CustomExecutionError
Returns a new instance of CustomExecutionError.
13 14 15 16 |
# File 'lib/graphql_rails/errors/custom_execution_error.rb', line 13 def initialize(, extra_graphql_data = {}) super() @extra_graphql_data = extra_graphql_data.stringify_keys end |
Instance Attribute Details
#extra_graphql_data ⇒ Object (readonly)
Returns the value of attribute extra_graphql_data.
6 7 8 |
# File 'lib/graphql_rails/errors/custom_execution_error.rb', line 6 def extra_graphql_data @extra_graphql_data end |
Class Method Details
.accepts?(error) ⇒ Boolean
8 9 10 11 |
# File 'lib/graphql_rails/errors/custom_execution_error.rb', line 8 def self.accepts?(error) error.is_a?(Hash) && (error.key?(:message) || error.key?('message')) end |
Instance Method Details
#to_h ⇒ Object
18 19 20 |
# File 'lib/graphql_rails/errors/custom_execution_error.rb', line 18 def to_h super end |