Exception: ZuoraAPI::Exceptions::ZuoraAPIError
- Defined in:
- lib/zuora_api/exceptions.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#successes ⇒ Object
readonly
Returns the value of attribute successes.
Instance Method Summary collapse
-
#initialize(message = nil, response = nil, errors = [], successes = [], *args) ⇒ ZuoraAPIError
constructor
A new instance of ZuoraAPIError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, response = nil, errors = [], successes = [], *args) ⇒ ZuoraAPIError
Returns a new instance of ZuoraAPIError.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/zuora_api/exceptions.rb', line 44 def initialize( = nil,response=nil, errors = [], successes = [], *args) @code = response.class.to_s == "HTTParty::Response" ? response.code : nil case when /Payment status should be Processed. Invalid payment is P-\d*./ = "Payment status should be Processed." when /Adjustment cannot be created for invoice(.*) with a zero balance./ = "Adjustment cannot be created for invoice with a zero balance." when /The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice .*./ = "The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice." else = end @response = response = "Error communicating with Zuora." @errors = errors @successes = successes end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
41 42 43 |
# File 'lib/zuora_api/exceptions.rb', line 41 def code @code end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
42 43 44 |
# File 'lib/zuora_api/exceptions.rb', line 42 def (value) = value end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
41 42 43 |
# File 'lib/zuora_api/exceptions.rb', line 41 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
41 42 43 |
# File 'lib/zuora_api/exceptions.rb', line 41 def response @response end |
#successes ⇒ Object (readonly)
Returns the value of attribute successes.
41 42 43 |
# File 'lib/zuora_api/exceptions.rb', line 41 def successes @successes end |
Instance Method Details
#to_s ⇒ Object
64 65 66 |
# File 'lib/zuora_api/exceptions.rb', line 64 def to_s || end |