Exception: DemoApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- DemoApi::Error
- Defined in:
- lib/demo_api/client.rb
Overview
Raised when the GraphQL API answers with errors.
Instance Attribute Summary collapse
-
#errors ⇒ Array<Hash>
readonly
The
errorsentries of the GraphQL response.
Instance Method Summary collapse
-
#initialize(errors) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(errors) ⇒ Error
Returns a new instance of Error.
14 15 16 17 |
# File 'lib/demo_api/client.rb', line 14 def initialize(errors) @errors = errors super(errors.map { |error| error['message'] }.join(', ')) end |
Instance Attribute Details
#errors ⇒ Array<Hash> (readonly)
Returns the errors entries of the GraphQL response.
11 12 13 |
# File 'lib/demo_api/client.rb', line 11 def errors @errors end |