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 +4 -4
- data/lib/frenchy/client.rb +3 -0
- data/lib/frenchy/error.rb +1 -0
- data/lib/frenchy/version.rb +1 -1
- data/spec/lib/frenchy/client_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c33034dadf83afbfbf323dc17f655e06aeafc8b
|
4
|
+
data.tar.gz: ef363621d4bf7e0ef39b1f6546440effbaa4df38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5d0aeaad2d4b2091764f029fae20a6fa00f2a421fc2753a38607bdda0f031f843c82ca595c4c88b18c0ff18b4de3781e347e293e7ab1a118b9ac9cfe4765864
|
7
|
+
data.tar.gz: 235fdf96cc08c9bd2690767a2f769a6a0a0bbe4a9cc5cbe1041948ab0cd3340652d18318e1810e96e16b882383e852664960563a98f316669b2c592a29cd9532
|
data/lib/frenchy/client.rb
CHANGED
@@ -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)
|
data/lib/frenchy/error.rb
CHANGED
data/lib/frenchy/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|