Exception: Wepay::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/wepay/error.rb

Overview

This error is raised when there is an error in the request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, message, code) ⇒ ApiError

Returns a new instance of ApiError.



11
12
13
14
15
# File 'lib/wepay/error.rb', line 11

def initialize(type, message, code)
  super(message)
  @type = type
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/wepay/error.rb', line 9

def code
  @code
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/wepay/error.rb', line 9

def type
  @type
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/wepay/error.rb', line 17

def message
  "#{type} (#{code}): #{super}"
end