restful_resource 2.5.2 → 2.5.3

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
  SHA256:
3
- metadata.gz: cb0d551d284814e63b1abe31b03f349ad6c75a8b39249a5c34f9d329c2853941
4
- data.tar.gz: 9c840127de8523bbbda9e2040ae321d7d8211e5cb2c65ed8d0c9bbaed764e54b
3
+ metadata.gz: 4e46af8066f1ca4d4e59dae90cd6283676f65e146ed62ab56c506eeafb189b95
4
+ data.tar.gz: fdbb7277f080e8c00ff73e5b01f26954d67dd04189456a4500276b0a435b8a41
5
5
  SHA512:
6
- metadata.gz: 87673da4a908520471c159f872cff232c9ed120421ba1ac8c6cb8307d8a3f1c7782881791b8a2c27afc1cc4e286f29fd1f60fbfbb108c394e6ef963b903b1ae2
7
- data.tar.gz: 0ee761effc856af7cbfe4605c277e3df5f6c589c58e07f172effc4128c7d557f55200a1355b56a20ac223d18c3d48094481fbb94a35205b6ee20d0cc0d71e22b
6
+ metadata.gz: 2039984d78d5131c8a88cb45fd7cc65a2626b2d2bee7977642ce10d84fd19f8d158ef7a7202f07e36dbf5ba4404cbf772f2f56f0f92497d1571f60f052dcfc68
7
+ data.tar.gz: c382b0c2d0f1f4901a990ef771104d0350536e6bd773bed632dcfc74d4f090577044b255bf49544fc2939ff9848d60efdbd020d0f55d16f6bb1db5e70e06eb8a
data/.circleci/config.yml CHANGED
@@ -2,7 +2,7 @@ version: 2
2
2
  jobs:
3
3
  build:
4
4
  docker:
5
- - image: circleci/ruby:2.4.4
5
+ - image: circleci/ruby:2.6
6
6
  steps:
7
7
  - checkout
8
8
  - run:
@@ -51,6 +51,12 @@ module RestfulResource
51
51
  end
52
52
  end
53
53
 
54
+ class GatewayTimeout < RetryableError
55
+ def message
56
+ 'HTTP 504: Gateway timeout'
57
+ end
58
+ end
59
+
54
60
  class Timeout < RetryableError
55
61
  def message
56
62
  'Timeout: Service not responding'
@@ -265,6 +271,7 @@ module RestfulResource
265
271
  when 429 then raise HttpClient::TooManyRequests.new(request, response)
266
272
  when 502 then raise HttpClient::BadGateway.new(request, response)
267
273
  when 503 then raise HttpClient::ServiceUnavailable.new(request, response)
274
+ when 504 then raise HttpClient::GatewayTimeout.new(request, response)
268
275
  else raise HttpClient::OtherHttpError.new(request, response)
269
276
  end
270
277
  end
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '2.5.2'.freeze
2
+ VERSION = '2.5.3'.freeze
3
3
  end
@@ -163,6 +163,14 @@ RSpec.describe RestfulResource::HttpClient do
163
163
  expect { http_client(connection).post('http://httpbin.org/status/503') }.to raise_error(RestfulResource::HttpClient::ServiceUnavailable)
164
164
  end
165
165
 
166
+ it 'post should raise error 504' do
167
+ connection = faraday_connection do |stubs|
168
+ stubs.post('http://httpbin.org/status/504') { |_env| [504, {}, nil] }
169
+ end
170
+
171
+ expect { http_client(connection).post('http://httpbin.org/status/504') }.to raise_error(RestfulResource::HttpClient::GatewayTimeout)
172
+ end
173
+
166
174
  it 'raises error on 404' do
167
175
  connection = faraday_connection do |stubs|
168
176
  stubs.get('http://httpbin.org/status/404') { |_env| [404, {}, nil] }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoro
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-31 00:00:00.000000000 Z
12
+ date: 2019-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler