Exception: ChargeBee::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- ChargeBee::APIError
- Defined in:
- lib/chargebee/api_error.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#json_obj ⇒ Object
readonly
Returns the value of attribute json_obj.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(message = nil, http_code = nil, http_body = nil, json_obj = nil) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, http_code = nil, http_body = nil, json_obj = nil) ⇒ APIError
Returns a new instance of APIError.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/chargebee/api_error.rb', line 6 def initialize(=nil, http_code=nil, http_body=nil, json_obj = nil) @message = @http_code = http_code @http_body = http_body @json_obj = json_obj if(json_obj != nil) @error_code = json_obj[:error_code] @param = json_obj[:param] end end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def error_code @error_code end |
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def http_body @http_body end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def http_code @http_code end |
#json_obj ⇒ Object (readonly)
Returns the value of attribute json_obj.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def json_obj @json_obj end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def @message end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
4 5 6 |
# File 'lib/chargebee/api_error.rb', line 4 def param @param end |
Instance Method Details
#to_s ⇒ Object
17 18 19 20 |
# File 'lib/chargebee/api_error.rb', line 17 def to_s hc = @http_code.nil? ? "" : "(Http Code #{@http_code}) " "#{hc}#{@message}" end |