restful_resource 1.2.0 → 1.2.1

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: 94dbc257e152348fda0f4b1381d5a6d7afb66c40
4
- data.tar.gz: b1fc1f23a20c2365a1719252cabf31476f871078
3
+ metadata.gz: db211e69eaa5a728787f648586539ee4f2e7973f
4
+ data.tar.gz: 90b99d72f60ede0ab07d59e4ebbbd257d5c75b3b
5
5
  SHA512:
6
- metadata.gz: 7fb25b7153a41750238c38a23c7a3cb57af69c6de0a452eb755af5d52280d9843d858c21618550a5669c30794a42ca77385d07dc8e44e55016e93768c891be27
7
- data.tar.gz: 43d7807af24db80d11b764ee81598d5ffd25dd69f4e7c166e5b3a74e5386b36381782c7ef1277253a88114f0d49ab55df665da7cd182dbebeeed6d5b57b6de27
6
+ metadata.gz: 16060fe0a969d7e693ab6bc1117b601c61be1692a05cf96a2f9895d606a08d6137a334f630367f5ca215c53deaa1bade441aab17a7a65d5fb7301af2beb23a9d
7
+ data.tar.gz: 6be2ba5e9eae8c91f38b1adaa97ce291196f0fc5b0d4375653896e2ac842ffd523401647aafdfca9e4cfee0016bd9d9230e542143415059e83c98c21cab8cbe4
@@ -30,6 +30,16 @@ module RestfulResource
30
30
  end
31
31
  end
32
32
 
33
+ class ClientError < HttpError
34
+ def initalize(request)
35
+ super(request, {})
36
+ end
37
+
38
+ def message
39
+ "There was some client error"
40
+ end
41
+ end
42
+
33
43
  def initialize(username: nil, password: nil, logger: nil, cache_store: nil)
34
44
  @client = Faraday.new do |b|
35
45
  if username.present? && password.present?
@@ -90,6 +100,7 @@ module RestfulResource
90
100
  raise
91
101
  rescue Faraday::ClientError => e
92
102
  response = e.response
103
+ raise ClientError.new(request) unless response
93
104
  case response[:status]
94
105
  when 404 then raise HttpClient::ResourceNotFound.new(request, response)
95
106
  when 422 then raise HttpClient::UnprocessableEntity.new(request, response)
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
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.2.0
4
+ version: 1.2.1
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: 2016-10-17 00:00:00.000000000 Z
12
+ date: 2016-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler