Exception: GraphQL::DSL::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/graphql/dsl/error.rb

Overview

GraphQL DSL error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, **arguments) ⇒ Error

Create GraphQL error

Parameters:

  • msg (String) (defaults to: nil)

    error message

  • arguments (Hash)

    additional error arguments



17
18
19
20
21
# File 'lib/graphql/dsl/error.rb', line 17

def initialize(msg = nil, **arguments)
  super(msg)

  @arguments = arguments
end

Instance Attribute Details

#argumentsHash (readonly)

Returns additional error arguments.

Returns:

  • (Hash)

    additional error arguments



10
11
12
# File 'lib/graphql/dsl/error.rb', line 10

def arguments
  @arguments
end

Instance Method Details

#messageString

Error message

Returns:

  • (String)

    error message



27
28
29
# File 'lib/graphql/dsl/error.rb', line 27

def message
  super + (arguments ? "\nArguments: #{arguments}" : '')
end