zuora_api 1.7.17 → 1.7.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 +4 -4
- data/lib/zuora_api/exceptions.rb +18 -0
- data/lib/zuora_api/login.rb +18 -4
- data/lib/zuora_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb51eeb1448871a76a3e1429eb204f1507d7f4405b4ede77fd24bed15aaff806
|
4
|
+
data.tar.gz: 50d2dbe87c32d5698252a49f9e745da6ffba82cb852b61b7a2b148856dc35f2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc6db039b8d26469e3e86d76b51d1beb340d92f99429419a89651075239eac42ded4e460b19932b0704c8bef3df5163e996e16e29b01f3c92d7b11bc23ae5c34
|
7
|
+
data.tar.gz: ed05311385f9bbc15a0bd690adbd000a3ad132938638416a18c44e71066c975f9849c10c34737bdb9940d23013e60e376f62032a334c87256eee3ad091fe40a5
|
data/lib/zuora_api/exceptions.rb
CHANGED
@@ -55,6 +55,24 @@ module ZuoraAPI
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
class ZuoraAPIInternalServerError < Error
|
59
|
+
attr_reader :code, :response, :errors, :successes
|
60
|
+
attr_writer :default_message
|
61
|
+
|
62
|
+
def initialize(message = nil,response = nil, errors = [], successes = [], *args)
|
63
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
64
|
+
@message = message
|
65
|
+
@response = response
|
66
|
+
@default_message = "Zuora Internal Server Error."
|
67
|
+
@errors = errors
|
68
|
+
@successes = successes
|
69
|
+
end
|
70
|
+
|
71
|
+
def to_s
|
72
|
+
@message || @default_message
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
58
76
|
class ZuoraAPIRequestLimit < Error
|
59
77
|
attr_reader :code, :response
|
60
78
|
attr_writer :default_message
|
data/lib/zuora_api/login.rb
CHANGED
@@ -30,7 +30,9 @@ module ZuoraAPI
|
|
30
30
|
ZuoraAPI::Exceptions::ZuoraAPIRequestLimit,
|
31
31
|
ZuoraAPI::Exceptions::ZuoraAPILockCompetition,
|
32
32
|
ZuoraAPI::Exceptions::ZuoraAPITemporaryError,
|
33
|
-
ZuoraAPI::Exceptions::ZuoraDataIntegrity
|
33
|
+
ZuoraAPI::Exceptions::ZuoraDataIntegrity,
|
34
|
+
ZuoraAPI::Exceptions::ZuoraAPIInternalServerError,
|
35
|
+
ZuoraAPI::Exceptions::ZuoraUnexpectedError
|
34
36
|
].freeze
|
35
37
|
|
36
38
|
attr_accessor :region, :url, :wsdl_number, :current_session, :bearer_token, :oauth_session_expires_at, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name, :entity_id, :timeout_sleep, :hostname, :zconnect_provider
|
@@ -580,15 +582,25 @@ module ZuoraAPI
|
|
580
582
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{error}::#{message}", response)
|
581
583
|
end
|
582
584
|
else
|
583
|
-
|
585
|
+
if response.code == 500
|
586
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new('Zuora API Internal Server Error', response)
|
587
|
+
else
|
588
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{error}::#{message}", response) if error.present?
|
589
|
+
end
|
584
590
|
end
|
585
591
|
elsif error.class == Array
|
586
592
|
if error[0].include?("LOCK_COMPETITION") && error.count == 1
|
587
593
|
raise ZuoraAPI::Exceptions::ZuoraAPILockCompetition.new(error.group_by {|v| v}.map {|k,v| "(#{v.size}x) - #{k == "::" ? 'UNKNOWN::No error provided' : k}"}.join(', '), response)
|
588
594
|
else
|
589
|
-
|
595
|
+
if response.code == 500
|
596
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new('Zuora API Internal Server Error', response)
|
597
|
+
else
|
598
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(error.group_by {|v| v}.map {|k,v| "(#{v.size}x) - #{k == "::" ? 'UNKNOWN::No error provided' : k}"}.join(', '), response, error, success)
|
599
|
+
end
|
590
600
|
end
|
591
601
|
end
|
602
|
+
elsif response.code == 500
|
603
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new('Zuora API Internal Server Error', response)
|
592
604
|
end
|
593
605
|
|
594
606
|
when :JSON
|
@@ -701,7 +713,9 @@ module ZuoraAPI
|
|
701
713
|
end
|
702
714
|
|
703
715
|
#All other errors
|
704
|
-
if
|
716
|
+
if response.code == 500
|
717
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new('Zuora API Internal Server Error', response)
|
718
|
+
elsif ![200,201].include?(response.code)
|
705
719
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{response.message}", response)
|
706
720
|
end
|
707
721
|
end
|
data/lib/zuora_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zuora Strategic Solutions Group
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|