Merge pull request #657 from michael-lazar/feature/default_to_popular

Default to /r/popular instead of /r/front if the page cant be loaded …
This commit is contained in:
Michael Lazar
2019-03-03 17:53:47 -05:00
committed by GitHub

View File

@@ -211,10 +211,11 @@ def main():
page = SubredditPage(reddit, term, config, oauth, name) page = SubredditPage(reddit, term, config, oauth, name)
except Exception as e: except Exception as e:
# If we can't load the subreddit that was requested, try # If we can't load the subreddit that was requested, try
# to load the front page instead so at least the # to load the "popular" page instead so at least the
# application still launches. # application still launches. This used to use the user's
# front page, but some users have an empty front page.
_logger.exception(e) _logger.exception(e)
page = SubredditPage(reddit, term, config, oauth, 'front') page = SubredditPage(reddit, term, config, oauth, 'popular')
raise SubredditError('Unable to load {0}'.format(name)) raise SubredditError('Unable to load {0}'.format(name))
if page is None: if page is None:
return return