lib/frenchy/client.rb in frenchy-0.3.0 vs lib/frenchy/client.rb in frenchy-0.4.0
- old
+ new
@@ -104,9 +104,12 @@
begin
JSON.parse(resp.body)
rescue => ex
raise Frenchy::InvalidResponse.new(ex, reqinfo, resp)
end
+ when 400
+ # Explicitly handle bad request errors
+ raise Frenchy::BadRequest.new(nil, reqinfo, resp)
when 404
# Explicitly handle not found errors
raise Frenchy::NotFound.new(nil, reqinfo, resp)
when 503, 504
# Explicitly handle temporarily unavailable errors