lib/detect_language/client.rb in detect_language-1.0.6 vs lib/detect_language/client.rb in detect_language-1.0.7
- old
+ new
@@ -36,13 +36,13 @@
request.add_field('User-Agent', configuration.user_agent)
response = http.request(request)
case response
- when Net::HTTPSuccess, Net::HTTPUnauthorized then
- parse_response(response.body)
- else
- raise "Failure: #{response.class}"
+ when Net::HTTPSuccess, Net::HTTPUnauthorized then
+ parse_response(response.body)
+ else
+ raise(Error, "Failure: #{response.class}")
end
end
def parse_response(response_body)
response = JSON.parse(response_body)