mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-04 07:26:14 +02:00
Update and modularize exception handling
cc #1024 #1141 - Stack traces are no longer shown to users unless the --debug flag is being used - Errors, warnings, and other messages contain color as needed - Converted error messages to Enum - Adds print_msg function to centralize output (this should replace all other output in other modules) Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
49930e16f7
commit
09c04aa5de
9 changed files with 135 additions and 63 deletions
|
@ -1,11 +1,13 @@
|
|||
import textwrap
|
||||
|
||||
from jrnl.exception import JrnlError
|
||||
from jrnl.exception import JrnlException
|
||||
from jrnl.exception import JrnlExceptionMessage
|
||||
|
||||
|
||||
def test_config_directory_exception_message():
|
||||
ex = JrnlError(
|
||||
"ConfigDirectoryIsFile", config_directory_path="/config/directory/path"
|
||||
ex = JrnlException(
|
||||
JrnlExceptionMessage.ConfigDirectoryIsFile,
|
||||
config_directory_path="/config/directory/path",
|
||||
)
|
||||
|
||||
assert ex.message == textwrap.dedent(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue