Exception: RubyReactor::Error::InputValidationError
- Defined in:
- lib/ruby_reactor/error/input_validation_error.rb
Instance Attribute Summary collapse
-
#field_errors ⇒ Object
readonly
Returns the value of attribute field_errors.
-
#step_arguments ⇒ Object
Step attribution, set at the raise site when the failure happened at a step boundary (argument or output validation) rather than at reactor input validation.
-
#step_name ⇒ Object
Step attribution, set at the raise site when the failure happened at a step boundary (argument or output validation) rather than at reactor input validation.
Attributes inherited from Base
#context, #original_error, #step
Instance Method Summary collapse
- #build_message ⇒ Object
-
#initialize(field_errors) ⇒ InputValidationError
constructor
A new instance of InputValidationError.
- #to_s ⇒ Object
Constructor Details
#initialize(field_errors) ⇒ InputValidationError
Returns a new instance of InputValidationError.
12 13 14 15 16 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 12 def initialize(field_errors) @field_errors = field_errors @message = super(@message) end |
Instance Attribute Details
#field_errors ⇒ Object (readonly)
Returns the value of attribute field_errors.
6 7 8 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 6 def field_errors @field_errors end |
#step_arguments ⇒ Object
Step attribution, set at the raise site when the failure happened at a step boundary (argument or output validation) rather than at reactor input validation. Nil for reactor-level input failures.
10 11 12 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 10 def step_arguments @step_arguments end |
#step_name ⇒ Object
Step attribution, set at the raise site when the failure happened at a step boundary (argument or output validation) rather than at reactor input validation. Nil for reactor-level input failures.
10 11 12 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 10 def step_name @step_name end |
Instance Method Details
#build_message ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 18 def return "Input validation failed" if field_errors.empty? = field_errors.map do |field, errors| "#{field} #{errors}" end "Input validation failed: #{.join(", ")}" end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 28 def to_s @message || end |