Exception: Async::Matrix::Schema::ValidationError
- Defined in:
- lib/async/matrix/schema/validation_error.rb
Overview
Raised by Event#valid! when data fails schema validation.
Produces detailed, human-readable error messages that identify the exact key path and offending value.
Schema validation failed for m.room.member event $abc123:
- content.membership = "invalid" -- must be one of: ["invite", "join", "knock", "leave", "ban"]
- sender is required but missing
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(errors, event_type: nil, event_id: nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(errors, event_type: nil, event_id: nil) ⇒ ValidationError
Returns a new instance of ValidationError.
26 27 28 29 30 31 |
# File 'lib/async/matrix/schema/validation_error.rb', line 26 def initialize(errors, event_type: nil, event_id: nil) @errors = errors @event_type = event_type @event_id = event_id super("M_BAD_JSON", ) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'lib/async/matrix/schema/validation_error.rb', line 21 def errors @errors end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
21 22 23 |
# File 'lib/async/matrix/schema/validation_error.rb', line 21 def event_id @event_id end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
21 22 23 |
# File 'lib/async/matrix/schema/validation_error.rb', line 21 def event_type @event_type end |