Exception: Graphlient::Errors::ExecutionError
- Defined in:
- lib/graphlient/errors/execution_error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(response) ⇒ ExecutionError
constructor
A new instance of ExecutionError.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ ExecutionError
Returns a new instance of ExecutionError.
6 7 8 9 |
# File 'lib/graphlient/errors/execution_error.rb', line 6 def initialize(response) super('the server responded with a GraphQL execution error') @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/graphlient/errors/execution_error.rb', line 4 def response @response end |
Instance Method Details
#errors ⇒ Object
11 12 13 |
# File 'lib/graphlient/errors/execution_error.rb', line 11 def errors response.data.errors end |
#to_s ⇒ Object
15 16 17 18 19 20 |
# File 'lib/graphlient/errors/execution_error.rb', line 15 def to_s errors.details.map do |key, details| details = create_details(details).join("\n") [key, details].compact.join(': ') end.join("\n") end |