travis 1.6.7.travis.420.4 → 1.6.7.travis.422.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjA5ODBiYjQ2ZWMyNTc3MzQwMTQxOTFiMDUzODQ5NjY2ZWI0YmJhMQ==
4
+ OTAzODJjNTFhZDM3M2RiNmRlZmMxODNjZDhiNjE1NWFlZmEzY2JhNQ==
5
5
  data.tar.gz: !binary |-
6
- YWZkOGZlZTU4M2ZhZDNjYjY1ZGNjNzA5YzkyZDg4Mjc0NDM4ZDdkZg==
6
+ Y2E4MWMwYzVkMmU0MmEyNWJmNjY4ZDJkYmQ1NTIwZjE0OTExNGJmZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWNmMmI1OTVhOTY0MzVkZDU2MDI4NzcwOTBmYWUyNjMzZmNlMzUxZGZkNzU4
10
- M2QwOGQzNzUxOTRhMzNmMTU3M2U5NmI1YzMyYmY4NTY3M2NmNTM1ZTY4NmNh
11
- YzQyMzZjMmZmYTVlZmY2MjEzYWU4NTA3MTdhNzQ2ZDVhMjcxNmQ=
9
+ ZmQ3YTlhMDNkMDQ5YWY5YWFhZTMyOTdmMzlmZTliODIyMjUyMjYxMDA1ZTdk
10
+ NjdiZTI1MmUzNDJjNzY5NWMwYjY2ZTNhYTMyZDI4OThkNWNhZWJkYmZhMGM3
11
+ MzE3OGFkYWY4ZDM2MWExZjBlYzNhNzg3N2YwZDg0OTBhODA3MzA=
12
12
  data.tar.gz: !binary |-
13
- NDY1NzllZTJiODY4MzAzZTM1ZTMzOTlhYTg4ZDNmN2Y5ZWQ2MzBhZmFlZDYy
14
- NGNkYjFmNzZiNzc3YjY0ZmQ2NzQ2YWUwMThhNGYwYjM0YTEwNDc2Yjg4NDEw
15
- ZTI0N2MyZDA3M2U2ZjZlNGY1ZjdlMDUyODZkZTA5ZDI0Y2FkMDE=
13
+ NDNmMGVjMGQzZjIxZjhhYjM0NzkwNzBhMDQzMWQzY2UxNDI2MzRhOGQwNzk3
14
+ YjJiODQ5OWVjMzg1YmI3NjM4ZjlmYmVkOTc1MTI2YWE1M2MzNmQ1OTA1YTIw
15
+ Yzg2MTQ1MmIzZDc0Y2Q1OGZjNmNiOTc5MDkwYmU2ZTZjOGZhMjE=
data/README.md CHANGED
@@ -1555,6 +1555,10 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
1555
1555
 
1556
1556
  ## Version History
1557
1557
 
1558
+ **1.6.7** (not yet released)
1559
+
1560
+ * Better error message when using an invalid access token.
1561
+
1558
1562
  **1.6.6** (December 16, 2013)
1559
1563
 
1560
1564
  * Fix `travis login --pro` for new users.
@@ -167,10 +167,12 @@ module Travis
167
167
  run(*arguments)
168
168
  clear_error
169
169
  store_config
170
+ rescue Travis::Client::NotLoggedIn => e
171
+ raise(e) if explode?
172
+ error "#{e.message} - try running #{command("login#{endpoint_option}")}"
170
173
  rescue StandardError => e
171
174
  raise(e) if explode?
172
175
  message = e.message
173
- message += " - try running #{command("login#{endpoint_option}")}" if Travis::Client::Error === e and message == 'access denied'
174
176
  message += color("\nfor a full error report, run #{command("report#{endpoint_option}")}", :error) if interactive?
175
177
  store_error(e)
176
178
  error(message)
@@ -8,7 +8,7 @@ module Travis
8
8
  class NotFound < Error
9
9
  end
10
10
 
11
- class NotLoggedIn < NotFound
11
+ class NotLoggedIn < Error
12
12
  end
13
13
  end
14
14
  end
@@ -206,9 +206,11 @@ module Travis
206
206
  when 200..299 then JSON.parse(result.body) rescue result.body
207
207
  when 301, 303 then raw(:get, result.headers['Location'])
208
208
  when 302, 307, 308 then raw(verb, result.headers['Location'])
209
- when 404 then raise Travis::Client::NotFound, result.body
210
- when 400..499 then raise Travis::Client::Error, result.status
211
- when 500..599 then raise Travis::Client::Error, "server error (#{result.status})"
209
+ when 401 then raise Travis::Client::NotLoggedIn, 'not logged in'
210
+ when 403 then raise Travis::Client::NotLoggedIn, 'invalid access token'
211
+ when 404 then raise Travis::Client::NotFound, result.body
212
+ when 400..499 then raise Travis::Client::Error, result.status
213
+ when 500..599 then raise Travis::Client::Error, "server error (#{result.status})"
212
214
  else raise Travis::Client::Error, "unhandled status code #{result.status}"
213
215
  end
214
216
  end
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.6.7.travis.420.4
4
+ version: 1.6.7.travis.422.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase