iban_client 0.0.3 → 0.0.5

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: f0fa08c6d9600a3514e1f918e946720d5cee99b9
4
- data.tar.gz: d4e5ee0bdd74451b80edf18209a5869f77dd5083
3
+ metadata.gz: b7df8de7aae7c779d5551a620419a77a91d1cfa4
4
+ data.tar.gz: f062a2997b2f76ec7076b2e7cd5b757a42f711af
5
5
  SHA512:
6
- metadata.gz: a48569faf547dac2eb5284a5253eb1867262227104541aff0bdfee32e4ab3c606a545e9245cfd670859488a8006c1195f7f79a3c744d8131088439a063884e56
7
- data.tar.gz: eeea6eb87bfc230045b6837adc1e5d19d635f8fa0d5041a301bebb7d388fa7c8b180c71f9d396f2a7a913ac6429a42a6e732ffa5ffdd614fabbd8be79e2471af
6
+ metadata.gz: 4b2a5fc57289573cc95a3b3c0397eedc2b2dcbff07e528829152e18e61263bb92d15beda2a763f6b3af21b6949dbeb2684e75f055f74258bb88228d8c1e4352a
7
+ data.tar.gz: 10a5349ba36cfd9ef64a3c4be55bf14fd321d08a154a4b009d9dc5b5e14df468805dc8dfe71cb2cb55e96aa47f6c31dc3f359a3a6f757c032d58414bc07ccc3f
@@ -8,17 +8,17 @@ module IbanClient
8
8
  end
9
9
 
10
10
  class RequestError < Error
11
- attr_reader :initial_error
11
+ attr_reader :response
12
12
 
13
- def initialize(iban:, initial_error:)
14
- @initial_error = initial_error
13
+ def initialize(iban:, response:)
14
+ @response = response
15
15
  super(iban: iban)
16
16
  end
17
17
 
18
18
  def message
19
19
  "#{initial_error.message}\n"\
20
20
  "Request iban: #{iban}\n"\
21
- "Response: #{initial_error.response}"
21
+ "Response: #{response}"
22
22
  end
23
23
  end
24
24
 
@@ -52,7 +52,7 @@ module IbanClient
52
52
  timeout: IbanClient.timeout
53
53
  )
54
54
  rescue RestClient::ExceptionWithResponse => err
55
- raise IbanClient::RequestError.new(iban: iban, initial_error: err)
55
+ raise IbanClient::RequestError.new(iban: iban, response: err.response)
56
56
  end
57
57
 
58
58
  def params
@@ -74,6 +74,8 @@ module IbanClient
74
74
  def handle_result(&block)
75
75
  raise IbanClient::AccountError.new(iban: iban, errors: api_errors) if api_errors.count > 0
76
76
  yield
77
+ rescue JSON::ParserError => err
78
+ raise IbanClient::RequestError.new(iban: iban, response: request)
77
79
  end
78
80
  end
79
81
  end
@@ -1,3 +1,3 @@
1
1
  module IbanClient
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iban_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Pochet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: 1.8.11
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.5.2
155
+ rubygems_version: 2.6.14.1
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Iban.com client