Fixed some error messages

This commit is contained in:
Michael Lazar
2016-06-23 23:06:41 -07:00
parent a2a0001943
commit a5a42fc5da
2 changed files with 5 additions and 2 deletions

View File

@@ -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):

View File

@@ -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: