Exception: GraphQL::Client::ResponseErrors
- Includes:
- Enumerable
- Defined in:
- lib/graphql/client/response.rb
Overview
Public: A collection of errors received from the server on execution.
Extends StandardError hierarchy so you may raise this instance.
Examples
raise response.errors
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(definition, errors) ⇒ ResponseErrors
constructor
Internal: Initialize ResponseErrors.
Constructor Details
#initialize(definition, errors) ⇒ ResponseErrors
Internal: Initialize ResponseErrors.
130 131 132 133 134 |
# File 'lib/graphql/client/response.rb', line 130 def initialize(definition, errors) @request_definition = definition @errors = errors.map { |error| ResponseError.new(definition, error) } super @errors.map(&:message).join(", ") end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
127 128 129 |
# File 'lib/graphql/client/response.rb', line 127 def errors @errors end |
Instance Method Details
#each(&block) ⇒ Object
136 137 138 |
# File 'lib/graphql/client/response.rb', line 136 def each(&block) errors.each(&block) end |