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.



35
36
37
38
39
# File 'lib/little_ghost/errors.rb', line 35

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.



32
33
34
# File 'lib/little_ghost/errors.rb', line 32

def schema_name
  @schema_name
end

#validation_errorsObject (readonly)

Declared schema name and validation messages returned by local checking.



32
33
34
# File 'lib/little_ghost/errors.rb', line 32

def validation_errors
  @validation_errors
end