Exception: Synthra::Errors::PathError
- Inherits:
-
ParseError
- Object
- StandardError
- Error
- ParseError
- Synthra::Errors::PathError
- Defined in:
- lib/synthra/errors.rb
Overview
Invalid path in copy() reference
Raised when a copy() type references a path that doesn't exist in the schema structure. Includes "did you mean" suggestions for similar paths.
Constant Summary collapse
- ERROR_CODE =
"PATH_ERROR"
Instance Attribute Summary collapse
-
#available_paths ⇒ Array<String>
readonly
List of valid paths available.
-
#path ⇒ String
readonly
The invalid path that was referenced.
Instance Method Summary collapse
-
#initialize(path, available_paths: [], suggestions: nil, **kwargs) ⇒ PathError
constructor
Create a new PathError.
Constructor Details
#initialize(path, available_paths: [], suggestions: nil, **kwargs) ⇒ PathError
Create a new PathError
301 302 303 304 305 |
# File 'lib/synthra/errors.rb', line 301 def initialize(path, available_paths: [], suggestions: nil, **kwargs) @path = path @available_paths = available_paths super("Path '#{path}' not found in schema", suggestions: suggestions, **kwargs) end |
Instance Attribute Details
#available_paths ⇒ Array<String> (readonly)
Returns list of valid paths available.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/synthra/errors.rb', line 288 class PathError < ParseError ERROR_CODE = "PATH_ERROR" attr_reader :path, :available_paths # Create a new PathError # # @param path [String] the path that wasn't found # @param available_paths [Array<String>] list of valid paths # @param suggestions [Array<String>] similar paths # @param kwargs [Hash] location information (line, column, source_line) # def initialize(path, available_paths: [], suggestions: nil, **kwargs) @path = path @available_paths = available_paths super("Path '#{path}' not found in schema", suggestions: suggestions, **kwargs) end end |
#path ⇒ String (readonly)
Returns the invalid path that was referenced.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/synthra/errors.rb', line 288 class PathError < ParseError ERROR_CODE = "PATH_ERROR" attr_reader :path, :available_paths # Create a new PathError # # @param path [String] the path that wasn't found # @param available_paths [Array<String>] list of valid paths # @param suggestions [Array<String>] similar paths # @param kwargs [Hash] location information (line, column, source_line) # def initialize(path, available_paths: [], suggestions: nil, **kwargs) @path = path @available_paths = available_paths super("Path '#{path}' not found in schema", suggestions: suggestions, **kwargs) end end |