gorilla-io 0.0.5 → 0.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1904d188b45bdfe6353a5c8636a3573731b35128
|
4
|
+
data.tar.gz: e911407881119b7194bb128af046bc2233b96113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66d684a64f1c8ea9709723ee4a5f13f291a6c958e8b5e06404245bf65f6b5f3501009a73fd1726fcb825f65eaad80abc0ebfc552e9d4569823af44d6187ce4ab
|
7
|
+
data.tar.gz: e291e43d2ac9201f3647e5434da476e11981d7e55f33b1ba6cee488c82a21b109b9dd6c0fbf3423a17e0a3eb2b5f8d7c91f9dde168bb8a40753f0510d4dee738
|
@@ -22,14 +22,14 @@ module Gorilla
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def raise_error(klass, response)
|
25
|
-
msg = if response[:body].kind_of?(Hash)
|
26
|
-
|
27
|
-
error['code'] + ' - ' + error['message']
|
25
|
+
msg = if response[:body].kind_of?(Hash) && response[:body]['error']
|
26
|
+
response[:body]['error']['type']
|
28
27
|
else
|
29
28
|
response[:body]
|
30
29
|
end
|
31
30
|
|
32
|
-
|
31
|
+
error_message = [response[:status], msg].compact.join(': ')
|
32
|
+
raise klass.new(response), error_message
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/lib/gorilla/version.rb
CHANGED
@@ -17,8 +17,8 @@ RSpec.describe_response_middleware Gorilla::Middleware::HttpExceptions do
|
|
17
17
|
|
18
18
|
it 'raises a Gorilla::Error with the correct message from a Hash' do
|
19
19
|
expect {
|
20
|
-
process({'error' => {'
|
21
|
-
}.to raise_error(Gorilla::Error, '400: code
|
20
|
+
process({'error' => {'type' => 'code'}}, 400)
|
21
|
+
}.to raise_error(Gorilla::Error, '400: code')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'raises a Gorilla::Error with the correct message from a String' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorilla-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gorilla.io
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|