Exception: Rospatent::Errors::ValidationError
- Inherits:
-
InvalidRequestError
- Object
- StandardError
- Error
- InvalidRequestError
- Rospatent::Errors::ValidationError
- Defined in:
- lib/rospatent/errors.rb
Overview
Raised for validation errors with detailed field information
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(message, errors = {}) ⇒ ValidationError
constructor
Initialize a new validation error.
- #to_s ⇒ Object
Constructor Details
#initialize(message, errors = {}) ⇒ ValidationError
Initialize a new validation error
105 106 107 108 |
# File 'lib/rospatent/errors.rb', line 105 def initialize(, errors = {}) @errors = errors super() end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
100 101 102 |
# File 'lib/rospatent/errors.rb', line 100 def errors @errors end |
Instance Method Details
#to_s ⇒ Object
110 111 112 113 114 115 116 117 |
# File 'lib/rospatent/errors.rb', line 110 def to_s msg = super if @errors&.any? field_errors = @errors.map { |field, error| "#{field}: #{error}" } msg += " (#{field_errors.join(', ')})" end msg end |