From a5a42fc5dab8ad48e7118828fe2c4a458e0633a1 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Thu, 23 Jun 2016 23:06:41 -0700 Subject: [PATCH] Fixed some error messages --- rtv/subreddit.py | 5 ++++- rtv/terminal.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rtv/subreddit.py b/rtv/subreddit.py index 21b87b6..d931cea 100644 --- a/rtv/subreddit.py +++ b/rtv/subreddit.py @@ -120,9 +120,12 @@ class SubredditPage(Page): submission_info = docs.SUBMISSION_FILE.format(name=name) with self.term.open_editor(submission_info) as text: - if not text or '\n' not in text: + if not text: self.term.show_notification('Canceled') return + elif '\n' not in text: + self.term.show_notification('Missing body') + return title, content = text.split('\n', 1) with self.term.loader('Posting', delay=0): diff --git a/rtv/terminal.py b/rtv/terminal.py index ccad825..26c9144 100644 --- a/rtv/terminal.py +++ b/rtv/terminal.py @@ -428,7 +428,7 @@ class Terminal(object): # All exceptions will cause the file to *not* be removed, but these # ones should also be swallowed _logger.info('Caught TemporaryFileError') - self.show_notification('File saved as: {}'.format(text)) + self.show_notification('Post saved as: {}'.format(filepath)) else: # If no errors occurred, try to remove the file try: