From 476f2307216796c945110e9fc5f3380bb740e9ff Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 18 Jun 2018 20:10:24 +0300 Subject: Change: if getting token gives error, show humane error message --- icktool | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'icktool') 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() -- cgit v1.2.1