summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ick2/client.py2
-rwxr-xr-xicktool6
2 files changed, 6 insertions, 2 deletions
diff --git a/ick2/client.py b/ick2/client.py
index dff3dc3..2b1318c 100644
--- a/ick2/client.py
+++ b/ick2/client.py
@@ -123,7 +123,7 @@ class HttpAPI:
r = func(url, headers=headers, verify=self._verify, **kwargs)
if not r.ok:
- raise HttpError(r.status_code)
+ raise HttpError('{}: {}'.format(r.status_code, r.text))
return r
diff --git a/icktool b/icktool
index 8edd3a0..0866661 100755
--- a/icktool
+++ b/icktool
@@ -179,7 +179,11 @@ class Icktool(cliapp.Application):
return self.settings['token']
ac = self._new_auth(api)
scopes = ' '.join(self.settings['scope'])
- return ac.get_token(scopes)
+ try:
+ return ac.get_token(scopes)
+ except ick2.HttpError as e:
+ sys.stderr.write('Error getting token: %s\n' % str(e))
+ sys.exit(1)
def _get_client_creds(self, url):
cp = configparser.ConfigParser()