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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f694a6c0c307fa3cc9b936f3ca3442033aa34673e2a24f424f5c7444fdf665c1
4
- data.tar.gz: eb14f1e3f913f7786bd2fe0dd13a7541487c55c30017c7a60a3db28465010767
3
+ metadata.gz: 9e3b33b3915e9e74136de9c6aa0268c27ea3d4cb4ae516cf8200a8c609670a2d
4
+ data.tar.gz: 4b5ed8b39801b907f4dc45318482b063cad651b32b51a483d30c31bd1932554b
5
5
  SHA512:
6
- metadata.gz: 33fbedf6a54f2bccbf976b790f9cca71ef76e2983a9e53b765ea5955fb6d990f8c0ebe553e21dda6374458603a238a16cea7f3b3cab623fad03092cadb15627e
7
- data.tar.gz: af4f17c765f05a25f8bc35f46e90ebe42deeeca2e122fe6610c2e17a29cb25ba5ff0f0aaa18865948ba6fd76cf0e0590c167e3c42e5e1685f26e95293030a163
6
+ metadata.gz: 3abd6d96d224419fbe3390ba5f972616d68afec035864e826d5fa45ef3905ce011794f0dbdb5da23b0aba1f79a095aea2991b8f08b4503f0a2dca1df1a26faa1
7
+ data.tar.gz: d990890d9581e171476f7b460e1aaa1f9f5f96735156f685129e7febc62bb17a1335cd7c2fa874064434e5150e4f3867f9efa2afc9be25611476dfcf1a65b57f
@@ -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})"
@@ -14,6 +14,9 @@ module Travis
14
14
  class NotLoggedIn < Error
15
15
  end
16
16
 
17
+ class RepositoryMigrated < Error
18
+ end
19
+
17
20
  class ValidationFailed < Error
18
21
  attr_reader :errors
19
22
 
@@ -35,4 +38,4 @@ module Travis
35
38
  end
36
39
  end
37
40
  end
38
- end
41
+ end
@@ -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 raise Travis::Client::NotLoggedIn, 'invalid access token'
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.10.travis.994.9
4
+ version: 1.8.10.travis.997.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase