Exception: Graphlient::Errors::GraphQLError
- Defined in:
- lib/graphlient/errors/graphql_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) ⇒ GraphQLError
constructor
A new instance of GraphQLError.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ GraphQLError
Returns a new instance of GraphQLError.
5 6 7 8 |
# File 'lib/graphlient/errors/graphql_error.rb', line 5 def initialize(response) super('the server responded with a GraphQL error') @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/graphlient/errors/graphql_error.rb', line 4 def response @response end |
Instance Method Details
#errors ⇒ Object
10 11 12 |
# File 'lib/graphlient/errors/graphql_error.rb', line 10 def errors @response.errors end |
#to_s ⇒ Object
14 15 16 17 18 19 |
# File 'lib/graphlient/errors/graphql_error.rb', line 14 def to_s errors.details.map do |key, details| details = create_details(details).join("\n") [key == 'data' ? nil : key, details].compact.join(': ') end.join("\n") end |