Exception: GQL::Errors::NoMethodError

Inherits:
GQL::Error
  • Object
show all
Defined in:
lib/gql/errors.rb

Instance Attribute Summary collapse

Attributes inherited from GQL::Error

#code, #handle

Instance Method Summary collapse

Methods inherited from GQL::Error

#as_json

Constructor Details

#initialize(node_class, id, cause) ⇒ NoMethodError

Returns a new instance of NoMethodError.



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/gql/errors.rb', line 75

def initialize(node_class, id, cause)
  @cause = cause

  msg =  "Undefined method `#{id}' for #{node_class}. "
  msg << "Did you try to add a field of type `#{id}'? "
  msg << "If so, you have to register your field type first "
  msg << "like this: `GQL.field_types[:#{id}] = My#{id.to_s.camelize}'. "
  msg << "The following field types are currently registered: "
  msg << GQL.field_types.keys.sort.map { |key| "`#{key}'" }.to_sentence

  super(msg, 122)
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



73
74
75
# File 'lib/gql/errors.rb', line 73

def cause
  @cause
end