taxjar-ruby 3.0.1 → 3.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bd370b061b002cddb9e65f2a879beed9e11c82678eccaa4b6e3b4b6ceb4c053
4
- data.tar.gz: b45f569333906938d5f656442549124f06b12c9dc51c47db9af3a0a29e312730
3
+ metadata.gz: 59f7440e50a1552f055f03501341b8883c960d9e85d50de6817ec7b7ca3908a1
4
+ data.tar.gz: 74712431ab3d1ad24fdfd064aa61cbdf53f5b47061d6eb61e032405ca9e2a539
5
5
  SHA512:
6
- metadata.gz: 6960458fd1bb6c89eaeb5f817b15c70a5e68b5b23f6232c05be63273fe02be92102797b989eaaacd76ee77ffa97cef67cdf413293d2a351300633a7d1d51f51a
7
- data.tar.gz: fe9903162754fa2c551d1dd4a88fc1bdd270bc92ac5fedeb1489ecc38a817cee5d93bfbf386442f3b3006df082ff8b31e692a24e6a1a95c716cee8d2b5917077
6
+ metadata.gz: 73aa9395d63a8b078699b23dcac7e97555831de2846db337e5ea32861fc6f3722589c6c0437eb7c8349d2f53614227f54cb11506d94370dbbac15f8c49fd7ea5
7
+ data.tar.gz: 95d3fb22ef2bcbf85fd5e256eb628765f8f1698ebedd5527b9f3fbc952357aa0fe6b3e04f87727dc4493c5feb7741ca309e73d3d93d1337c780083fc0cd6f8eb
data/CHANGELOG.md CHANGED
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.0.2] - 2021-03-18
11
+ - Re-classify `HTTP::ConnectionError` and other `HTTP::Error` types as `Taxjar::Error`
12
+
10
13
  ## [3.0.1] - 2021-03-16
11
14
  - Throw a `Taxjar::Error` exception for any non-successful HTTP response
12
15
 
@@ -46,7 +49,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
46
49
  - Update minimum required Ruby version to 2.0
47
50
  - Update HTTP (The Gem) to 2.2
48
51
 
49
- [Unreleased]: https://github.com/taxjar/taxjar-ruby/compare/v3.0.1...HEAD
52
+ [Unreleased]: https://github.com/taxjar/taxjar-ruby/compare/v3.0.2...HEAD
53
+ [3.0.2]: https://github.com/taxjar/taxjar-ruby/compare/v3.0.1...v3.0.2
50
54
  [3.0.1]: https://github.com/taxjar/taxjar-ruby/compare/v3.0.0...v3.0.1
51
55
  [3.0.0]: https://github.com/taxjar/taxjar-ruby/compare/v2.6.1...v3.0.0
52
56
  [2.6.1]: https://github.com/taxjar/taxjar-ruby/compare/v2.6.0...v2.6.1
@@ -35,6 +35,8 @@ module Taxjar
35
35
  nil
36
36
  end
37
37
  fail_or_return_response_body(response, response_body)
38
+ rescue HTTP::Error => e
39
+ raise Taxjar::Error, e
38
40
  end
39
41
 
40
42
  private
@@ -10,7 +10,7 @@ module Taxjar
10
10
  end
11
11
 
12
12
  def patch
13
- 1
13
+ 2
14
14
  end
15
15
 
16
16
  def pre
@@ -175,6 +175,24 @@ describe Taxjar::API::Request do
175
175
  expect{subject.perform}.to raise_error(Taxjar::Error::ServerError)
176
176
  end
177
177
 
178
+ [
179
+ HTTP::Error,
180
+ HTTP::ConnectionError,
181
+ HTTP::RequestError,
182
+ HTTP::ResponseError,
183
+ HTTP::StateError,
184
+ HTTP::TimeoutError,
185
+ HTTP::HeaderError
186
+ ].each do |http_error_class|
187
+ context "#{http_error_class}" do
188
+ it "is classified as a Taxjar::Error" do
189
+ stub_request(:get, "https://api.taxjar.com/api_path").to_raise(http_error_class)
190
+
191
+ expect{subject.perform}.to raise_error(Taxjar::Error)
192
+ end
193
+ end
194
+ end
195
+
178
196
  Taxjar::Error::ERRORS.each do |status, exception|
179
197
  context "when HTTP status is #{status}" do
180
198
  it "raises #{exception}" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taxjar-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TaxJar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -202,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubyforge_project:
206
- rubygems_version: 2.7.6.2
205
+ rubygems_version: 3.2.14
207
206
  signing_key:
208
207
  specification_version: 4
209
208
  summary: Ruby wrapper for Taxjar API