Exception: Ibex::Runtime::CST::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/json5/generated_parser.rb

Overview

Structured failure raised for an invalid or incompatible CST document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, path:, message:, expected: nil, actual: nil) ⇒ ValidationError

Returns a new instance of ValidationError.

RBS:

  • (code: Symbol, path: String, message: String, ?expected: json_value, ?actual: json_value) -> void



2174
2175
2176
2177
2178
2179
2180
# File 'lib/json5/generated_parser.rb', line 2174

def initialize(code:, path:, message:, expected: nil, actual: nil)
  @code = code
  @path = path.dup.freeze
  @expected = expected
  @actual = actual
  super("(cst):#{path}: #{message}")
end

Instance Attribute Details

#actualObject (readonly)

Signature:

  • json_value



2171
2172
2173
# File 'lib/json5/generated_parser.rb', line 2171

def actual
  @actual
end

#codeObject (readonly)

Signature:

  • Symbol



2168
2169
2170
# File 'lib/json5/generated_parser.rb', line 2168

def code
  @code
end

#expectedObject (readonly)

Signature:

  • json_value



2170
2171
2172
# File 'lib/json5/generated_parser.rb', line 2170

def expected
  @expected
end

#pathObject (readonly)

Signature:

  • String



2169
2170
2171
# File 'lib/json5/generated_parser.rb', line 2169

def path
  @path
end