lib/fizzy/api/sessions/basic_auth_session.rb in fizzy-api-0.0.3 vs lib/fizzy/api/sessions/basic_auth_session.rb in fizzy-api-0.0.4
- old
+ new
@@ -45,21 +45,18 @@
response = yield
case response.code
when 401
access_denied(response)
when 500
- fail response.parsed_response || "Received HTTP response code #{response.code}!"
+ raise response.parsed_response || "Received HTTP response code #{response.code}!"
else
response
end
end
def access_denied(response)
- if response.headers['WWW-Authenticate']
- fail NoSession
- else
- fail Unauthorized
- end
+ raise NoSession if response.headers['WWW-Authenticate']
+ raise Unauthorized
end
def full_url_for(path)
fizzy_url + api_base + path
end