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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e46af8066f1ca4d4e59dae90cd6283676f65e146ed62ab56c506eeafb189b95
|
4
|
+
data.tar.gz: fdbb7277f080e8c00ff73e5b01f26954d67dd04189456a4500276b0a435b8a41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2039984d78d5131c8a88cb45fd7cc65a2626b2d2bee7977642ce10d84fd19f8d158ef7a7202f07e36dbf5ba4404cbf772f2f56f0f92497d1571f60f052dcfc68
|
7
|
+
data.tar.gz: c382b0c2d0f1f4901a990ef771104d0350536e6bd773bed632dcfc74d4f090577044b255bf49544fc2939ff9848d60efdbd020d0f55d16f6bb1db5e70e06eb8a
|
data/.circleci/config.yml
CHANGED
@@ -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
|
@@ -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.
|
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-
|
12
|
+
date: 2019-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|