zuora_api 1.6.19 → 1.6.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zuora_api/exceptions.rb +15 -0
- data/lib/zuora_api/login.rb +8 -8
- data/lib/zuora_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b66a64866c65694fb3c7943a3c6f25ee6c140c00
|
4
|
+
data.tar.gz: 4ecb82d9f5f0b4436114faa52d64dfa51ac64792
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d62f26e1458614ab146fb2757ac07fdcec18389630082d73092ddbd21c5d1a78cc36cb7ad60d0d1a678f719a515e70b27ced3c01a004389f1009aa7cffcaef
|
7
|
+
data.tar.gz: 2c95f895ca912ce1eaad5cc4c1d1b6087eb19e4b315f8c9fed91651b91afbc268f8834e47a9cccb1624894dd17d60973047aaea516a2c9a967de5520fe56cc38
|
data/lib/zuora_api/exceptions.rb
CHANGED
@@ -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
|
data/lib/zuora_api/login.rb
CHANGED
@@ -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
|
-
|
499
|
+
case error
|
500
|
+
when "INVALID_SESSION"
|
500
501
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("#{error}::#{message}", body, response.code )
|
501
|
-
|
502
|
-
if error == "REQUEST_EXCEEDED_LIMIT"
|
502
|
+
when "REQUEST_EXCEEDED_LIMIT"
|
503
503
|
raise ZuoraAPI::Exceptions::ZuoraAPIRequestLimit.new("#{error}::#{message}", body, response.code)
|
504
|
-
|
505
|
-
if error == "LOCK_COMPETITION"
|
504
|
+
when "LOCK_COMPETITION"
|
506
505
|
raise ZuoraAPI::Exceptions::ZuoraAPILockCompetition.new("#{error}::#{message}", body, response.code)
|
507
|
-
|
508
|
-
|
509
|
-
|
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
|
data/lib/zuora_api/version.rb
CHANGED