Class: Recharge::RequestError

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

Overview

Raised when a non-2XX HTTP response is returned or a response with an error or warning property

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status, meta = nil, errors = nil) ⇒ RequestError

Returns a new instance of RequestError.



22
23
24
25
26
27
# File 'lib/recharge.rb', line 22

def initialize(message, status, meta = nil, errors = nil)
  super message
  @status = status
  @meta = meta || {}
  @errors = errors || {}
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



18
19
20
# File 'lib/recharge.rb', line 18

def errors
  @errors
end

#metaObject

Returns the value of attribute meta.



20
21
22
# File 'lib/recharge.rb', line 20

def meta
  @meta
end

#statusObject

Returns the value of attribute status.



19
20
21
# File 'lib/recharge.rb', line 19

def status
  @status
end