Exception: ApimaticCalculator::ValidationException

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

Overview

Class for exceptions when there is a schema validation error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, template) ⇒ ValidationException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.



13
14
15
16
# File 'lib/apimatic_calculator/exceptions/validation_exception.rb', line 13

def initialize(value, template)
  @reason = "The value #{value} provided doesn't validate against the schema #{template}"
  super(reason)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



9
10
11
# File 'lib/apimatic_calculator/exceptions/validation_exception.rb', line 9

def reason
  @reason
end