restful_resource 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/restful_resource/http_client.rb +6 -4
- data/lib/restful_resource/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d5e2aea53f19955e18f69aaad8665f69e6eddb1
|
4
|
+
data.tar.gz: e5fba7439a0a7c12965aac6b9ea6491e527da288
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2562be29a322e337f2b3c616aa3cb04aa6be45de3964a1229bd7cdde896091dcb5bc06be485812588fa1bcedec3a716578a74b6636133e9331ad156e10c115e6
|
7
|
+
data.tar.gz: 7e2252c2a662db143f7d3517a683bde0da89a093de2fd86d316e4a4e2abe0acedb0163078f6633ae014537ede07328a0e685df457ffad5f14f9f21a758a8dda3
|
data/CHANGELOG.md
ADDED
@@ -12,7 +12,7 @@ module RestfulResource
|
|
12
12
|
|
13
13
|
def assign_response(response = nil)
|
14
14
|
if response
|
15
|
-
@response = Response.new
|
15
|
+
@response = Response.new(body: response[:body], headers: response[:headers], status: response[:status])
|
16
16
|
else
|
17
17
|
@response = Response.new
|
18
18
|
end
|
@@ -28,25 +28,27 @@ module RestfulResource
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
class RetryableError < HttpError; end
|
32
|
+
|
31
33
|
class OtherHttpError < HttpError
|
32
34
|
def message
|
33
35
|
"HTTP Error - Status code: #{response.status}"
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
37
|
-
class ServiceUnavailable <
|
39
|
+
class ServiceUnavailable < RetryableError
|
38
40
|
def message
|
39
41
|
"HTTP 503: Service unavailable"
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
43
|
-
class Timeout <
|
45
|
+
class Timeout < RetryableError
|
44
46
|
def message
|
45
47
|
"Timeout: Service not responding"
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
|
-
class ClientError <
|
51
|
+
class ClientError < RetryableError
|
50
52
|
def message
|
51
53
|
"There was some client error"
|
52
54
|
end
|
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: 1.
|
4
|
+
version: 1.6.0
|
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: 2017-
|
12
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -175,6 +175,7 @@ extensions: []
|
|
175
175
|
extra_rdoc_files: []
|
176
176
|
files:
|
177
177
|
- ".gitignore"
|
178
|
+
- CHANGELOG.md
|
178
179
|
- Gemfile
|
179
180
|
- LICENSE.txt
|
180
181
|
- README.md
|