Exception: Interpol::ValidationError
- Defined in:
- lib/interpol/errors.rb
Overview
Error raised when data fails to validate against the schema for an endpoint.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors = [], data = nil, endpoint_description = '') ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(errors = [], data = nil, endpoint_description = '') ⇒ ValidationError
Returns a new instance of ValidationError.
20 21 22 23 24 25 26 27 28 |
# File 'lib/interpol/errors.rb', line 20 def initialize(errors = [], data = nil, endpoint_description = '') @errors = errors error_bullet_points = errors.map { |e| "\n - #{e}" }.join = "Found #{errors.size} error(s) when validating " + "against endpoint #{endpoint_description}. " + "Errors: #{error_bullet_points}.\n\nData:\n#{data.inspect}" super() end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
18 19 20 |
# File 'lib/interpol/errors.rb', line 18 def errors @errors end |