Exception: Pal::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pal.rb

Overview

Exception classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors, msg = "Invalid Request") ⇒ ValidationError

Returns a new instance of ValidationError.



34
35
36
37
# File 'lib/pal.rb', line 34

def initialize(errors, msg="Invalid Request")
  super(msg)
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



32
33
34
# File 'lib/pal.rb', line 32

def errors
  @errors
end

Instance Method Details

#messageObject



39
40
41
# File 'lib/pal.rb', line 39

def message
  "Validation error: [#{@errors.join(", ")}]"
end