Fixed some error messages
This commit is contained in:
@@ -120,9 +120,12 @@ class SubredditPage(Page):
|
|||||||
|
|
||||||
submission_info = docs.SUBMISSION_FILE.format(name=name)
|
submission_info = docs.SUBMISSION_FILE.format(name=name)
|
||||||
with self.term.open_editor(submission_info) as text:
|
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')
|
self.term.show_notification('Canceled')
|
||||||
return
|
return
|
||||||
|
elif '\n' not in text:
|
||||||
|
self.term.show_notification('Missing body')
|
||||||
|
return
|
||||||
|
|
||||||
title, content = text.split('\n', 1)
|
title, content = text.split('\n', 1)
|
||||||
with self.term.loader('Posting', delay=0):
|
with self.term.loader('Posting', delay=0):
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ class Terminal(object):
|
|||||||
# All exceptions will cause the file to *not* be removed, but these
|
# All exceptions will cause the file to *not* be removed, but these
|
||||||
# ones should also be swallowed
|
# ones should also be swallowed
|
||||||
_logger.info('Caught TemporaryFileError')
|
_logger.info('Caught TemporaryFileError')
|
||||||
self.show_notification('File saved as: {}'.format(text))
|
self.show_notification('Post saved as: {}'.format(filepath))
|
||||||
else:
|
else:
|
||||||
# If no errors occurred, try to remove the file
|
# If no errors occurred, try to remove the file
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user