Exception: Filterameter::Exceptions::ValidationError

Inherits:
FilterameterError show all
Defined in:
lib/filterameter/exceptions/validation_error.rb

Overview

# Validation Error

Class ValidationError is raised when a specified parameter fails a validation. Configuration setting ‘action_on_validation_failure` determines whether or not the exception is raised.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ValidationError

Returns a new instance of ValidationError.



12
13
14
15
# File 'lib/filterameter/exceptions/validation_error.rb', line 12

def initialize(errors)
  super
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



10
11
12
# File 'lib/filterameter/exceptions/validation_error.rb', line 10

def errors
  @errors
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/filterameter/exceptions/validation_error.rb', line 17

def message
  "The following parameter(s) failed validation: #{errors.full_messages}"
end