zuora_api 1.6.19 → 1.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1fc5fd80b603068e7275109a79cf583be06a555
4
- data.tar.gz: 14e5d8ba42672c04efa2bd1b6d66f7e7adb703d2
3
+ metadata.gz: b66a64866c65694fb3c7943a3c6f25ee6c140c00
4
+ data.tar.gz: 4ecb82d9f5f0b4436114faa52d64dfa51ac64792
5
5
  SHA512:
6
- metadata.gz: bf8783fdd21fb1d7374bd44b96841f1f36e43b42537b15a17aef6e67b7b2ddad6808acfb5bcbee0a30ff8775cbdf67b9b3b60abce14c3be830357c4fc092e503
7
- data.tar.gz: e7f594df58d83af49f7a308d66fd09632bcd45f058142da7e5a167aa2ca969591dfa903aa40e45159c57c1f67d03d94a4056a543bd312544304933d18642998a
6
+ metadata.gz: b4d62f26e1458614ab146fb2757ac07fdcec18389630082d73092ddbd21c5d1a78cc36cb7ad60d0d1a678f719a515e70b27ced3c01a004389f1009aa7cffcaef
7
+ data.tar.gz: 2c95f895ca912ce1eaad5cc4c1d1b6087eb19e4b315f8c9fed91651b91afbc268f8834e47a9cccb1624894dd17d60973047aaea516a2c9a967de5520fe56cc38
@@ -86,6 +86,21 @@ module ZuoraAPI
86
86
  end
87
87
  end
88
88
 
89
+ class ZuoraAPITemporaryError < Error
90
+ attr_reader :code, :response
91
+ attr_writer :default_message
92
+
93
+ def initialize(message = nil,response=nil, code =nil)
94
+ @code = code
95
+ @message = message
96
+ @response = response
97
+ @default_message = "There is a temporary error with zuora system."
98
+ end
99
+
100
+ def to_s
101
+ @message || @default_message
102
+ end
103
+ end
89
104
 
90
105
  class ZuoraAPIAuthenticationTypeError < Error
91
106
  attr_reader :code, :response
@@ -496,17 +496,17 @@ module ZuoraAPI
496
496
  #By default response if not passed in for SOAP as all SOAP is 200
497
497
  if error.present?
498
498
  if error.class == String
499
- if error == "INVALID_SESSION"
499
+ case error
500
+ when "INVALID_SESSION"
500
501
  raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("#{error}::#{message}", body, response.code )
501
- end
502
- if error == "REQUEST_EXCEEDED_LIMIT"
502
+ when "REQUEST_EXCEEDED_LIMIT"
503
503
  raise ZuoraAPI::Exceptions::ZuoraAPIRequestLimit.new("#{error}::#{message}", body, response.code)
504
- end
505
- if error == "LOCK_COMPETITION"
504
+ when "LOCK_COMPETITION"
506
505
  raise ZuoraAPI::Exceptions::ZuoraAPILockCompetition.new("#{error}::#{message}", body, response.code)
507
- end
508
- if error.present?
509
- raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{error}::#{message}", body, response.code)
506
+ when "TEMPORARY_ERROR"
507
+ raise ZuoraAPI::Exceptions::ZuoraAPITemporaryError.new("#{error}::#{message}", body, response.code)
508
+ else
509
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{error}::#{message}", body, response.code) if error.present?
510
510
  end
511
511
  elsif error.class == Array
512
512
  if error[0].include?("LOCK_COMPETITION") && error.count == 1
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.6.19"
2
+ VERSION = "1.6.20"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.19
4
+ version: 1.6.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group