Exception: SimpleGraphqlClient::Errors::ParserError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/simple_graphql_client/errors/parser_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, response) ⇒ ParserError

Returns a new instance of ParserError.



8
9
10
11
12
# File 'lib/simple_graphql_client/errors/parser_error.rb', line 8

def initialize(error, response)
  @error = error
  @response = response
  super(message)
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



6
7
8
# File 'lib/simple_graphql_client/errors/parser_error.rb', line 6

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/simple_graphql_client/errors/parser_error.rb', line 6

def response
  @response
end

Instance Method Details

#messageObject



14
15
16
# File 'lib/simple_graphql_client/errors/parser_error.rb', line 14

def message
  "Failed to parse response #{response.body[0..10]}... from #{response.request.inspect}."
end