Exception: GraphQL::StringEncodingError
- Inherits:
-
RuntimeTypeError
- Object
- StandardError
- Error
- RuntimeTypeError
- GraphQL::StringEncodingError
- Defined in:
- lib/graphql/string_encoding_error.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(str, context:) ⇒ StringEncodingError
constructor
A new instance of StringEncodingError.
Constructor Details
#initialize(str, context:) ⇒ StringEncodingError
Returns a new instance of StringEncodingError.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/graphql/string_encoding_error.rb', line 5 def initialize(str, context:) @string = str @field = context[:current_field] @path = context[:current_path] = "String #{str.inspect} was encoded as #{str.encoding}".dup if @path << " @ #{@path.join(".")}" end if @field << " (#{@field.path})" end << ". GraphQL requires an encoding compatible with UTF-8." super() end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/graphql/string_encoding_error.rb', line 4 def field @field end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/graphql/string_encoding_error.rb', line 4 def path @path end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
4 5 6 |
# File 'lib/graphql/string_encoding_error.rb', line 4 def string @string end |