Exception: ChargeBee::APIError

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

Instance Attribute Summary collapse

Attributes inherited from Error

#original_error

Instance Method Summary collapse

Constructor Details

#initialize(http_code = nil, json_obj = nil) ⇒ APIError

Returns a new instance of APIError.



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/chargebee/errors.rb', line 20

def initialize(http_code=nil, json_obj = nil)
  super json_obj[:message]
  @json_obj = json_obj
  @http_status_code = http_code
  @type = json_obj[:type]
  @api_error_code = json_obj[:api_error_code]
  @param = json_obj[:param]

  #Deprecated attributes
  @error_code = json_obj[:error_code]
  @http_code = http_code
  @http_body = json_obj.to_s
end

Instance Attribute Details

#api_error_codeObject (readonly)

Returns the value of attribute api_error_code.



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

def api_error_code
  @api_error_code
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



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

def error_code
  @error_code
end

#http_bodyObject (readonly)

Returns the value of attribute http_body.



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

def http_body
  @http_body
end

#http_codeObject (readonly)

Returns the value of attribute http_code.



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

def http_code
  @http_code
end

#http_status_codeObject (readonly)

Returns the value of attribute http_status_code.



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

def http_status_code
  @http_status_code
end

#json_objObject (readonly)

Returns the value of attribute json_obj.



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

def json_obj
  @json_obj
end

#paramObject (readonly)

Returns the value of attribute param.



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

def param
  @param
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end