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.
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.
8 9 10 11 12 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 8 def initialize(field_errors) @field_errors = field_errors = super() 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 |
Instance Method Details
#build_message ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 14 def return "Input validation failed" if field_errors.empty? = field_errors.map do |field, errors| "#{field} #{errors}" end "Input validation failed: #{error_messages.join(", ")}" end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/ruby_reactor/error/input_validation_error.rb', line 24 def to_s || end |