Exception: GraphQL::DurationEncodingError

Inherits:
RuntimeTypeError show all
Defined in:
lib/graphql/duration_encoding_error.rb

Overview

This error is raised when Types::ISO8601Duration is asked to return a value that cannot be parsed as an ISO8601-formatted duration by ActiveSupport::Duration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ DurationEncodingError

Returns a new instance of DurationEncodingError.



11
12
13
14
# File 'lib/graphql/duration_encoding_error.rb', line 11

def initialize(value)
  @duration_value = value
  super("Duration cannot be parsed: #{value}. \nDuration must be an ISO8601-formatted duration.")
end

Instance Attribute Details

#duration_valueObject (readonly)

The value which couldn’t be encoded



9
10
11
# File 'lib/graphql/duration_encoding_error.rb', line 9

def duration_value
  @duration_value
end