frenchy 0.2.7 → 0.2.8

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: 14578cc89e3790bd2ec10cac3d8d106c92bb81d1
4
- data.tar.gz: ca7b4859677d522ffd5f1b994039f9463bd3b824
3
+ metadata.gz: 7c33034dadf83afbfbf323dc17f655e06aeafc8b
4
+ data.tar.gz: ef363621d4bf7e0ef39b1f6546440effbaa4df38
5
5
  SHA512:
6
- metadata.gz: cfb4d3a4064c40cfaa12ff7511d6ae08045e0aa65f475bb90076aa3c22d132fc1b36281845ada1c52b0fc4c6c0c92fc54252c9671bd3c1e647063d7e7232bc7d
7
- data.tar.gz: ac736a0ab6048fc99bbc5c80f4636c17ccff855cd628e96eeeed18df5aaaa9c65c901d0e74dbf51692d6bd5835f5328288179d01371135955fd174f81c991648
6
+ metadata.gz: f5d0aeaad2d4b2091764f029fae20a6fa00f2a421fc2753a38607bdda0f031f843c82ca595c4c88b18c0ff18b4de3781e347e293e7ab1a118b9ac9cfe4765864
7
+ data.tar.gz: 235fdf96cc08c9bd2690767a2f769a6a0a0bbe4a9cc5cbe1041948ab0cd3340652d18318e1810e96e16b882383e852664960563a98f316669b2c592a29cd9532
@@ -108,6 +108,9 @@ module Frenchy
108
108
  when 404
109
109
  # Explicitly handle not found errors
110
110
  raise Frenchy::NotFound.new(nil, reqinfo, resp)
111
+ when 503
112
+ # Explicitly handle temporarily unavailable errors
113
+ raise Frenchy::TemporarilyUnavailable.new(nil, reqinfo, resp)
111
114
  else
112
115
  # All other responses are treated as a server error
113
116
  raise Frenchy::ServiceUnavailable.new(nil, reqinfo, resp)
@@ -28,4 +28,5 @@ module Frenchy
28
28
  class InvalidResponse < RequestError; end
29
29
  class ServerError < RequestError; end
30
30
  class ServiceUnavailable < ServerError; end
31
+ class TemporarilyUnavailable < ServerError; end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module Frenchy
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -55,6 +55,11 @@ describe Frenchy::Client do
55
55
  expect{client.get("/status/404", {})}.to raise_error(Frenchy::NotFound)
56
56
  end
57
57
 
58
+ it "raises a temporarily unavailable error for 503 responses" do
59
+ client = Frenchy::Client.new("httpbin", "host" => "http://httpbin.org")
60
+ expect{client.get("/status/503", {})}.to raise_error(Frenchy::TemporarilyUnavailable)
61
+ end
62
+
58
63
  it "raises a service unavailable error for 500+ responses" do
59
64
  client = Frenchy::Client.new("httpbin", "host" => "http://httpbin.org")
60
65
  expect{client.get("/status/500", {})}.to raise_error(Frenchy::ServiceUnavailable)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frenchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Coene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-22 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json