Default to /r/popular instead of /r/front if the page cant be loaded at startup

This commit is contained in:
Michael Lazar
2019-03-03 17:51:33 -05:00
parent c6aecc8d30
commit aac5cd05d0

View File

@@ -211,10 +211,11 @@ def main():
page = SubredditPage(reddit, term, config, oauth, name)
except Exception as e:
# If we can't load the subreddit that was requested, try
# to load the front page instead so at least the
# application still launches.
# to load the "popular" page instead so at least the
# application still launches. This used to use the user's
# front page, but some users have an empty front page.
_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))
if page is None:
return