Exception: Insika::WorkflowSchemaError
- Inherits:
-
ValidationError
- Object
- StandardError
- Error
- ValidationError
- Insika::WorkflowSchemaError
- Defined in:
- lib/insika/errors.rb
Overview
Workflow I/O contract violation (item 22 / ยง4.4). A workflow may declare an
input_schema / output_schema; a value that does not conform is rejected.
INPUT is validated SYNCHRONOUSLY (TriggerWorkflow) so it is a ValidationError
-> HTTP 422, no run created. OUTPUT is validated inside the fiber after the
workflow returns -> task :failed at the :workflow_schema stage. errors is the
per-field detail (dry-schema-compatible #errors.to_h); phase is :input|:output.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
Instance Method Summary collapse
-
#initialize(message = nil, phase: nil, errors: {}) ⇒ WorkflowSchemaError
constructor
A new instance of WorkflowSchemaError.
Constructor Details
#initialize(message = nil, phase: nil, errors: {}) ⇒ WorkflowSchemaError
Returns a new instance of WorkflowSchemaError.
113 114 115 116 117 118 119 |
# File 'lib/insika/errors.rb', line 113 def initialize( = nil, phase: nil, errors: {}) @phase = phase @errors = errors || {} detail = @errors.map { |field, msgs| "#{field}: #{Array(msgs).join(', ')}" }.join("; ") base = || "workflow #{phase} failed schema validation" super(detail.empty? ? base : "#{base} (#{detail})") end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
111 112 113 |
# File 'lib/insika/errors.rb', line 111 def errors @errors end |
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
111 112 113 |
# File 'lib/insika/errors.rb', line 111 def phase @phase end |