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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b042ec375a2984815010c485cbef4add8802679b
4
- data.tar.gz: 2e157f25500fbec1e5f1efc95117d2cabed9b718
3
+ metadata.gz: 3d5e2aea53f19955e18f69aaad8665f69e6eddb1
4
+ data.tar.gz: e5fba7439a0a7c12965aac6b9ea6491e527da288
5
5
  SHA512:
6
- metadata.gz: ca46a2ac25d31c27ec7c5993a068d3e6db952e4d0eccf0e8a50ca51dd383ab3d28feafde047d8770499dfeec89612894029dfc0134506ebd18b65f6a6a2a1769
7
- data.tar.gz: 64c0dad6210f0729ae0e5603a78f187d2b697af52337074de47942c81ddc823ab734582249db2abe699e41ac73dcbf39e733dd0bcc78807843605866c1579e5d
6
+ metadata.gz: 2562be29a322e337f2b3c616aa3cb04aa6be45de3964a1229bd7cdde896091dcb5bc06be485812588fa1bcedec3a716578a74b6636133e9331ad156e10c115e6
7
+ data.tar.gz: 7e2252c2a662db143f7d3517a683bde0da89a093de2fd86d316e4a4e2abe0acedb0163078f6633ae014537ede07328a0e685df457ffad5f14f9f21a758a8dda3
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ v1.6.0
4
+ ---
5
+ - group ServiceUnavailable, Timeout, and ClientError as subclasses of RetryableError
6
+ [#20](https://github.com/carwow/restful_resource/pull/20)
@@ -12,7 +12,7 @@ module RestfulResource
12
12
 
13
13
  def assign_response(response = nil)
14
14
  if response
15
- @response = Response.new body: response[:body], headers: response[:headers], status: response[:status]
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 < HttpError
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 < HttpError
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 < HttpError
51
+ class ClientError < RetryableError
50
52
  def message
51
53
  "There was some client error"
52
54
  end
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  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.5.0
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-07-18 00:00:00.000000000 Z
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