Exception: LittleGhost::StructuredResultError

Inherits:
ProtocolError show all
Defined in:
lib/little_ghost/errors.rb

Overview

Raised when structured output is absent, invalid, or exceeds safety limits.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, schema_name:, validation_errors: []) ⇒ StructuredResultError

Records the schema and freezes normalized validation messages.



29
30
31
32
33
# File 'lib/little_ghost/errors.rb', line 29

def initialize(message, schema_name:, validation_errors: [])
  @schema_name = schema_name.to_s.freeze
  @validation_errors = Array(validation_errors).map(&:to_s).freeze
  super(message)
end

Instance Attribute Details

#schema_nameObject (readonly)

Declared schema name and validation messages returned by local checking.



26
27
28
# File 'lib/little_ghost/errors.rb', line 26

def schema_name
  @schema_name
end

#validation_errorsObject (readonly)

Declared schema name and validation messages returned by local checking.



26
27
28
# File 'lib/little_ghost/errors.rb', line 26

def validation_errors
  @validation_errors
end