travis 1.8.10.travis.994.9 → 1.8.10.travis.997.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/travis/cli/command.rb +3 -0
- data/lib/travis/client/error.rb +4 -1
- data/lib/travis/client/session.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e3b33b3915e9e74136de9c6aa0268c27ea3d4cb4ae516cf8200a8c609670a2d
|
4
|
+
data.tar.gz: 4b5ed8b39801b907f4dc45318482b063cad651b32b51a483d30c31bd1932554b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3abd6d96d224419fbe3390ba5f972616d68afec035864e826d5fa45ef3905ce011794f0dbdb5da23b0aba1f79a095aea2991b8f08b4503f0a2dca1df1a26faa1
|
7
|
+
data.tar.gz: d990890d9581e171476f7b460e1aaa1f9f5f96735156f685129e7febc62bb17a1335cd7c2fa874064434e5150e4f3867f9efa2afc9be25611476dfcf1a65b57f
|
data/lib/travis/cli/command.rb
CHANGED
@@ -201,6 +201,9 @@ module Travis
|
|
201
201
|
rescue Travis::Client::NotLoggedIn => e
|
202
202
|
raise(e) if explode?
|
203
203
|
error "#{e.message} - try running #{command("login#{endpoint_option}")}"
|
204
|
+
rescue Travis::Client::RepositoryMigrated => e
|
205
|
+
raise (e) if explode?
|
206
|
+
error e.message
|
204
207
|
rescue Travis::Client::NotFound => e
|
205
208
|
raise(e) if explode?
|
206
209
|
error "resource not found (#{e.message})"
|
data/lib/travis/client/error.rb
CHANGED
@@ -218,7 +218,13 @@ module Travis
|
|
218
218
|
when 301, 303 then raw(:get, result.headers['Location'])
|
219
219
|
when 302, 307, 308 then raw(verb, result.headers['Location'])
|
220
220
|
when 401 then raise Travis::Client::NotLoggedIn, 'not logged in'
|
221
|
-
when 403 then
|
221
|
+
when 403 then
|
222
|
+
body = JSON.parse(result.body) rescue {}
|
223
|
+
if body["error_type"] == "migrated_repository"
|
224
|
+
raise Travis::Client::RepositoryMigrated, body["error_message"]
|
225
|
+
else
|
226
|
+
raise Travis::Client::NotLoggedIn, 'invalid access token'
|
227
|
+
end
|
222
228
|
when 404 then raise Travis::Client::NotFound, result.body
|
223
229
|
when 422 then raise Travis::Client::ValidationFailed, result.body
|
224
230
|
when 400..499 then raise Travis::Client::Error, "%s: %p" % [result.status, result.body]
|