bing-ads 0.1.7 → 0.1.10
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/bing/ads/api/errors.rb +3 -0
- data/lib/bing/ads/api/v11/services/base.rb +12 -2
- data/lib/bing/ads/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb865140e65821f31450432bb087cb89143455d2
|
4
|
+
data.tar.gz: 02b9ad77ad75865f776349d756a8db170379755f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f267aae4e994cab02ef1e910a51c10958b7f1c7da008088fddcc3a403b25fd910138477729cb1c21a9afa3b4ef1a4bce9ea1d8eded3506ac22a760d8b34962ad
|
7
|
+
data.tar.gz: 3190d86f5f162e44ac0700ff48c3cad6c26412e74dbe5db166e56fc5809f3bc5eedf9bebeb66612a4ad84fb08f3bcfae1f8a9ed68f0537f59464b65117e56ceb
|
data/lib/bing/ads/api/errors.rb
CHANGED
@@ -8,6 +8,9 @@ module Bing
|
|
8
8
|
# Bing::Ads::API::Errors::AuthenticationTokenExpired
|
9
9
|
class AuthenticationTokenExpired < RuntimeError; end;
|
10
10
|
|
11
|
+
# Bing::Ads::API::Errors::UnhandledSOAPFault
|
12
|
+
class UnhandledSOAPFault < RuntimeError; end;
|
13
|
+
|
11
14
|
# Bing::Ads::API::Errors::LimitError
|
12
15
|
class LimitError < RuntimeError
|
13
16
|
def initialize(operation, limit, type)
|
@@ -57,11 +57,20 @@ module Bing
|
|
57
57
|
elsif fault_detail.key?(:ad_api_fault_detail)
|
58
58
|
handle_soap_fault(operation, fault_detail, :ad_api_fault_detail)
|
59
59
|
else
|
60
|
-
|
60
|
+
if retries_made < retry_attempts
|
61
|
+
sleep(2**retries_made)
|
62
|
+
retries_made += 1
|
63
|
+
retry
|
64
|
+
else
|
65
|
+
raise Bing::Ads::API::Errors::UnhandledSOAPFault,
|
66
|
+
"SOAP error (#{fault_detail.keys.join(', ')}) while calling #{operation}. #{error.message}"
|
67
|
+
end
|
61
68
|
end
|
62
69
|
rescue Savon::HTTPError => error
|
70
|
+
# TODO better handling
|
63
71
|
raise
|
64
72
|
rescue Savon::InvalidResponseError => error
|
73
|
+
# TODO better handling
|
65
74
|
raise
|
66
75
|
rescue
|
67
76
|
if retries_made < retry_attempts
|
@@ -112,7 +121,8 @@ module Bing
|
|
112
121
|
raise Bing::Ads::API::Errors::AuthenticationTokenExpired,
|
113
122
|
'renew authentication token or obtain a new one.'
|
114
123
|
else
|
115
|
-
raise
|
124
|
+
raise Bing::Ads::API::Errors::UnhandledSOAPFault,
|
125
|
+
"SOAP error (#{fault_detail[key]}) while calling #{operation}."
|
116
126
|
end
|
117
127
|
end
|
118
128
|
end
|
data/lib/bing/ads/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bing-ads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oss92
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|