mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Display "No entry to save, because no text was received" after empty entry on cmdline (#1459)
* Display "Entry not saved" after empty entry on cmdline * update error message
This commit is contained in:
parent
d21398ee60
commit
d6d6db0aa3
3 changed files with 20 additions and 8 deletions
|
@ -134,11 +134,9 @@ def write_mode(args, config, journal, **kwargs):
|
|||
else:
|
||||
raw = _write_in_editor(config)
|
||||
|
||||
if not raw:
|
||||
logging.error("Write mode: couldn't get raw text")
|
||||
raise JrnlException(
|
||||
Message(MsgText.JrnlExceptionMessage.NoTextReceived, MsgType.ERROR)
|
||||
)
|
||||
if not raw or raw.isspace():
|
||||
logging.error("Write mode: couldn't get raw text or entry was empty")
|
||||
raise JrnlException(Message(MsgText.NoTextReceived, MsgType.ERROR))
|
||||
|
||||
logging.debug(
|
||||
'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw
|
||||
|
|
|
@ -98,7 +98,7 @@ class MsgText(Enum):
|
|||
"""
|
||||
|
||||
NoTextReceived = """
|
||||
Nothing saved to file
|
||||
No entry to save, because no text was received
|
||||
"""
|
||||
|
||||
# --- Upgrade --- #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue