bing-ads 0.1.7 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d23f93c7fe4f5efe90c04005f59e26b240d56bf5
4
- data.tar.gz: 6d3cde8118e06a6b454284aadd01247f8d3bdfce
3
+ metadata.gz: fb865140e65821f31450432bb087cb89143455d2
4
+ data.tar.gz: 02b9ad77ad75865f776349d756a8db170379755f
5
5
  SHA512:
6
- metadata.gz: 9a0d495a745ea1aab39f608e74add9d3792beab32fc5b0cb3e7e3e0acab71893bce1fd5a598d693045cb975cd1fecab2a1d47ea6fbfd0a49184f1363ea413f1f
7
- data.tar.gz: 2998357b32c5c90760a4e8fec6a2b80dd43c4e6f1dd84e123d0a920f5753e9b6cdd2254c98c9227278a63917f086b6ae34b0f3a333ed6fc5175f8dffdc5dfac3
6
+ metadata.gz: f267aae4e994cab02ef1e910a51c10958b7f1c7da008088fddcc3a403b25fd910138477729cb1c21a9afa3b4ef1a4bce9ea1d8eded3506ac22a760d8b34962ad
7
+ data.tar.gz: 3190d86f5f162e44ac0700ff48c3cad6c26412e74dbe5db166e56fc5809f3bc5eedf9bebeb66612a4ad84fb08f3bcfae1f8a9ed68f0537f59464b65117e56ceb
@@ -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
- raise
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 "SOAP error while calling #{operation}, #{fault_detail[key]}"
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
@@ -1,5 +1,5 @@
1
1
  module Bing
2
2
  module Ads
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
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.7
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-08-28 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon