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 +8 -8
- data/README.md +4 -0
- data/lib/travis/cli/command.rb +3 -1
- data/lib/travis/client/error.rb +1 -1
- data/lib/travis/client/session.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTAzODJjNTFhZDM3M2RiNmRlZmMxODNjZDhiNjE1NWFlZmEzY2JhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2E4MWMwYzVkMmU0MmEyNWJmNjY4ZDJkYmQ1NTIwZjE0OTExNGJmZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmQ3YTlhMDNkMDQ5YWY5YWFhZTMyOTdmMzlmZTliODIyMjUyMjYxMDA1ZTdk
|
10
|
+
NjdiZTI1MmUzNDJjNzY5NWMwYjY2ZTNhYTMyZDI4OThkNWNhZWJkYmZhMGM3
|
11
|
+
MzE3OGFkYWY4ZDM2MWExZjBlYzNhNzg3N2YwZDg0OTBhODA3MzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
data/lib/travis/cli/command.rb
CHANGED
@@ -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)
|
data/lib/travis/client/error.rb
CHANGED
@@ -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
|
210
|
-
when
|
211
|
-
when
|
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
|