Exception: Graphiti::Errors::TypecastFailed
- Defined in:
- lib/graphiti/errors.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Instance Method Summary collapse
-
#initialize(resource, name, value, error, type_name) ⇒ TypecastFailed
constructor
A new instance of TypecastFailed.
- #message ⇒ Object
Constructor Details
#initialize(resource, name, value, error, type_name) ⇒ TypecastFailed
Returns a new instance of TypecastFailed.
562 563 564 565 566 567 568 |
# File 'lib/graphiti/errors.rb', line 562 def initialize(resource, name, value, error, type_name) @resource = resource @name = name @value = value @error = error @type_name = type_name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
560 561 562 |
# File 'lib/graphiti/errors.rb', line 560 def name @name end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
560 561 562 |
# File 'lib/graphiti/errors.rb', line 560 def type_name @type_name end |
Instance Method Details
#message ⇒ Object
570 571 572 573 574 575 576 577 578 |
# File 'lib/graphiti/errors.rb', line 570 def <<~MSG #{@resource.class}: Failed typecasting #{@name.inspect}! Given #{@value.inspect} but the following error was raised: #{@error.} #{@error.backtrace.join("\n")} MSG end |