summaryrefslogtreecommitdiff
path: root/icktool
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-06-18 20:10:24 +0300
committerLars Wirzenius <liw@liw.fi>2018-06-18 20:10:24 +0300
commit476f2307216796c945110e9fc5f3380bb740e9ff (patch)
treecea1efb9968c7354f42ce9d43693c6be20260dac /icktool
parentbb3a2df1a82cfd20477964e9cc8c26a1d4c33ae5 (diff)
downloadick2-476f2307216796c945110e9fc5f3380bb740e9ff.tar.gz
Change: if getting token gives error, show humane error message
Diffstat (limited to 'icktool')
-rwxr-xr-xicktool6
1 files changed, 5 insertions, 1 deletions
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()