diff --git a/rtv/__main__.py b/rtv/__main__.py index bb9337d..27c0387 100644 --- a/rtv/__main__.py +++ b/rtv/__main__.py @@ -160,10 +160,9 @@ def main(): subreddit = args.subreddit or 'front' page = SubredditPage(stdscr, reddit, oauth, subreddit) page.loop() - except praw.errors.OAuthAppRequired: - print('Invalid OAuth app config parameters') - except praw.errors.OAuthInvalidToken: - print('Invalid OAuth token') + except (praw.errors.OAuthAppRequired, praw.errors.OAuthInvalidToken, + praw.errors.HTTPException) as e: + print('Invalid OAuth data') except requests.ConnectionError: print('Connection timeout') except requests.HTTPError: diff --git a/rtv/oauth.py b/rtv/oauth.py index 3cf245d..81399de 100644 --- a/rtv/oauth.py +++ b/rtv/oauth.py @@ -117,7 +117,8 @@ class OAuthTool(object): access_token=self.access_info['access_token'], refresh_token=self.access_info['refresh_token']) self.set_token_expiration() - except (praw.errors.OAuthAppRequired, praw.errors.OAuthInvalidToken) as e: + except (praw.errors.OAuthAppRequired, praw.errors.OAuthInvalidToken, + praw.errors.HTTPException) as e: show_notification(self.stdscr, ['Invalid OAuth data']) else: self.config['oauth']['access_token'] = self.access_info['access_token']