Exception: Synthra::Errors::UnknownTypeError
- Inherits:
-
ParseError
- Object
- StandardError
- Error
- ParseError
- Synthra::Errors::UnknownTypeError
- Defined in:
- lib/synthra/errors.rb
Overview
Unknown type referenced in DSL
Raised when a field uses a type that hasn't been registered. This could be a typo or a custom type that wasn't defined. Includes "did you mean" suggestions for similar type names.
Constant Summary collapse
- ERROR_CODE =
"UNKNOWN_TYPE_ERROR"
Instance Attribute Summary collapse
-
#type_name ⇒ String
readonly
The unknown type name that was referenced.
Instance Method Summary collapse
-
#initialize(type_name, suggestions: nil, **kwargs) ⇒ UnknownTypeError
constructor
Create a new UnknownTypeError.
Constructor Details
#initialize(type_name, suggestions: nil, **kwargs) ⇒ UnknownTypeError
Create a new UnknownTypeError
264 265 266 267 |
# File 'lib/synthra/errors.rb', line 264 def initialize(type_name, suggestions: nil, **kwargs) @type_name = type_name super("Unknown type '#{type_name}'", suggestions: suggestions, **kwargs) end |
Instance Attribute Details
#type_name ⇒ String (readonly)
Returns the unknown type name that was referenced.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/synthra/errors.rb', line 252 class UnknownTypeError < ParseError ERROR_CODE = "UNKNOWN_TYPE_ERROR" attr_reader :type_name # Create a new UnknownTypeError # # @param type_name [String] the type name that wasn't found # @param suggestions [Array<String>] similar type names # @param kwargs [Hash] location information (line, column, source_line) # def initialize(type_name, suggestions: nil, **kwargs) @type_name = type_name super("Unknown type '#{type_name}'", suggestions: suggestions, **kwargs) end end |