Exception: ZuoraConnect::Exceptions::APIError
- Defined in:
- lib/zuora_connect/exceptions.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(message: nil, response: nil) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(message: nil, response: nil) ⇒ APIError
Returns a new instance of APIError.
43 44 45 46 47 48 |
# File 'lib/zuora_connect/exceptions.rb', line 43 def initialize(message: nil, response: nil) @code = response.class.to_s == "HTTParty::Response" ? response.code : nil @message = @response = response @default_message = "Connect update error." end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
40 41 42 |
# File 'lib/zuora_connect/exceptions.rb', line 40 def code @code end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
41 42 43 |
# File 'lib/zuora_connect/exceptions.rb', line 41 def (value) @default_message = value end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
40 41 42 |
# File 'lib/zuora_connect/exceptions.rb', line 40 def response @response end |
Instance Method Details
#to_s ⇒ Object
50 51 52 |
# File 'lib/zuora_connect/exceptions.rb', line 50 def to_s @message || @default_message end |