Exception: RuleBasedValidator::InvalidParametersException

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

Overview

Excepción para parámetros inválidos

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ InvalidParametersException

Returns a new instance of InvalidParametersException.



16
17
18
19
20
21
22
# File 'lib/rule_based_validator/exceptions.rb', line 16

def initialize(errors)
  super(message)
  @code    = 18
  @status  = 400
  @message = 'Parámetros inválidos'
  @body    = { errors: errors }
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



14
15
16
# File 'lib/rule_based_validator/exceptions.rb', line 14

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



14
15
16
# File 'lib/rule_based_validator/exceptions.rb', line 14

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



14
15
16
# File 'lib/rule_based_validator/exceptions.rb', line 14

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/rule_based_validator/exceptions.rb', line 14

def status
  @status
end