lib/travis/client/session.rb in travis-1.6.7.travis.420.4 vs lib/travis/client/session.rb in travis-1.6.7.travis.422.4
- old
+ new
@@ -204,12 +204,14 @@
case result.status
when 0 then raise Travis::Client::Error, 'SSL error: could not verify peer'
when 200..299 then JSON.parse(result.body) rescue result.body
when 301, 303 then raw(:get, result.headers['Location'])
when 302, 307, 308 then raw(verb, result.headers['Location'])
- when 404 then raise Travis::Client::NotFound, result.body
- when 400..499 then raise Travis::Client::Error, result.status
- when 500..599 then raise Travis::Client::Error, "server error (#{result.status})"
+ when 401 then raise Travis::Client::NotLoggedIn, 'not logged in'
+ when 403 then raise Travis::Client::NotLoggedIn, 'invalid access token'
+ when 404 then raise Travis::Client::NotFound, result.body
+ when 400..499 then raise Travis::Client::Error, result.status
+ when 500..599 then raise Travis::Client::Error, "server error (#{result.status})"
else raise Travis::Client::Error, "unhandled status code #{result.status}"
end
end
def inspect