Added logging and error handling for posts and comments.

This commit is contained in:
Michael Lazar
2015-04-05 18:29:12 -07:00
parent fea3540587
commit ea1230d30c
4 changed files with 32 additions and 13 deletions

View File

@@ -244,11 +244,12 @@ class BasePage(object):
return
try:
self.reddit.login(username, password)
with self.loader():
self.reddit.login(username, password)
except praw.errors.InvalidUserPass:
show_notification(self.stdscr, ['Invalid user/pass'])
else:
show_notification(self.stdscr, ['Logged in'])
show_notification(self.stdscr, ['Welcome {}'.format(username)])
def logout(self):
"Prompt to log out of the user's account."