Exception: RubyPayler::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/ruby_payler/errors.rb

Overview

Response.body contains error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



11
12
13
# File 'lib/ruby_payler/errors.rb', line 11

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/ruby_payler/errors.rb', line 9

def response
  @response
end

Instance Method Details

#codeObject

Payler error code



16
17
18
# File 'lib/ruby_payler/errors.rb', line 16

def code
  response_error.code
end

#messageObject

Payler error description



21
22
23
# File 'lib/ruby_payler/errors.rb', line 21

def message
  response_error.message
end

#to_sObject



25
26
27
# File 'lib/ruby_payler/errors.rb', line 25

def to_s
  "Payler responded with error: #{message}, code #{code}"
end