Exception: CustomException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/util/validation/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(merchant_message) ⇒ CustomException

Returns a new instance of CustomException.



4
5
6
7
8
9
10
11
12
# File 'lib/util/validation/error.rb', line 4

def initialize(merchant_message)
  @error_data = {
    "object" => "error",
    "type" => "param_error",
    "merchant_message" => merchant_message,
    "user_message" => merchant_message
  }
  super("CustomException: #{@error_data}")
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/util/validation/error.rb', line 14

def to_s
  JSON.generate(@error_data)
end