adcenter_api 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module AdcenterApi
2
2
  module ApiConfig
3
- CLIENT_LIB_VERSION = "0.0.1"
3
+ CLIENT_LIB_VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -90,6 +90,16 @@ AdsCommon::SavonService.class_eval do
90
90
  raise Exception.new("code #{operation_error[:code]}")
91
91
  end
92
92
  return exception_class.new("#{operation_error[:message]} (#{operation_error[:details]})")
93
+ # Specific to AdCenter (ad api)
94
+ elsif fault[:detail] and fault[:detail][:ad_api_fault_detail]
95
+ operation_error = fault[:detail][:ad_api_fault_detail][:errors][:ad_api_error]
96
+ operation_error = operation_error.first if operation_error.is_a?(Array) # if we get several errors, we only raise the first one
97
+ if exception_name = AdcenterApi::Errors::CODES[operation_error[:code]]
98
+ exception_class = AdcenterApi::Errors.const_get(exception_name)
99
+ else
100
+ raise Exception.new("code #{operation_error[:code]}")
101
+ end
102
+ return exception_class.new("#{operation_error[:message]} (#{operation_error[:details]})")
93
103
  elsif fault[:faultstring]
94
104
  fault_message = fault[:faultstring]
95
105
  return AdsCommon::Errors::ApiException.new(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adcenter_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,31 +11,9 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: savon
16
- requirement: &2153226260 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 1.0.0
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *2153226260
25
- - !ruby/object:Gem::Dependency
26
- name: httpi
27
- requirement: &2153225760 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ~>
31
- - !ruby/object:Gem::Version
32
- version: 1.0.0
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *2153225760
36
14
  - !ruby/object:Gem::Dependency
37
15
  name: activesupport
38
- requirement: &2153225300 !ruby/object:Gem::Requirement
16
+ requirement: &2165880020 !ruby/object:Gem::Requirement
39
17
  none: false
40
18
  requirements:
41
19
  - - ! '>='
@@ -43,10 +21,10 @@ dependencies:
43
21
  version: 3.1.0
44
22
  type: :runtime
45
23
  prerelease: false
46
- version_requirements: *2153225300
24
+ version_requirements: *2165880020
47
25
  - !ruby/object:Gem::Dependency
48
26
  name: google-ads-common
49
- requirement: &2153224920 !ruby/object:Gem::Requirement
27
+ requirement: &2165879580 !ruby/object:Gem::Requirement
50
28
  none: false
51
29
  requirements:
52
30
  - - ! '>='
@@ -54,10 +32,10 @@ dependencies:
54
32
  version: '0'
55
33
  type: :runtime
56
34
  prerelease: false
57
- version_requirements: *2153224920
35
+ version_requirements: *2165879580
58
36
  - !ruby/object:Gem::Dependency
59
37
  name: rake
60
- requirement: &2153240820 !ruby/object:Gem::Requirement
38
+ requirement: &2165879100 !ruby/object:Gem::Requirement
61
39
  none: false
62
40
  requirements:
63
41
  - - ! '>='
@@ -65,10 +43,10 @@ dependencies:
65
43
  version: '0'
66
44
  type: :development
67
45
  prerelease: false
68
- version_requirements: *2153240820
46
+ version_requirements: *2165879100
69
47
  - !ruby/object:Gem::Dependency
70
48
  name: rspec
71
- requirement: &2153240320 !ruby/object:Gem::Requirement
49
+ requirement: &2165878560 !ruby/object:Gem::Requirement
72
50
  none: false
73
51
  requirements:
74
52
  - - ~>
@@ -76,7 +54,7 @@ dependencies:
76
54
  version: '2.8'
77
55
  type: :development
78
56
  prerelease: false
79
- version_requirements: *2153240320
57
+ version_requirements: *2165878560
80
58
  description: Ruby wrapper for Microsoft Adcenter API
81
59
  email:
82
60
  - arambert@optimeez.com