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: 1e4c6f1e55ec9b526c9db08ec5e1f59ed3d47e30
4
- data.tar.gz: f4f35c5309f62a75f3873cd6d9f19649f29f9f3d
3
+ metadata.gz: 1904d188b45bdfe6353a5c8636a3573731b35128
4
+ data.tar.gz: e911407881119b7194bb128af046bc2233b96113
5
5
  SHA512:
6
- metadata.gz: b4720f23efc4008f2ee223649ab67e1c7175918522973f08958331eeb4d97917e115cc3ae745521a4ff09d023559e9d6a39bec6d8fd78da44295ac3d77ffc53b
7
- data.tar.gz: 9376e419059b64a4d69fc2252a20ee7d616ebca3a35cd37b669d2c3c88e710a7aeacb0862cf3b3bddd0b45db41e623899976f988e3ec12f1e11e80c04890e9b5
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
- error = response[:body]['error']
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
- raise klass.new(response), [response[:status], msg].compact.join(': ')
31
+ error_message = [response[:status], msg].compact.join(': ')
32
+ raise klass.new(response), error_message
33
33
  end
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Gorilla
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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' => {'code' => 'code', 'message' => 'message'}}, 400)
21
- }.to raise_error(Gorilla::Error, '400: code - message')
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.5
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-01-30 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler