mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16: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,6 +1,7 @@
|
|||
import pytest
|
||||
|
||||
from jrnl.exception import JrnlError
|
||||
from jrnl.exception import JrnlException
|
||||
from jrnl.exception import JrnlExceptionMessage
|
||||
from jrnl.plugins.fancy_exporter import check_provided_linewrap_viability
|
||||
|
||||
|
||||
|
@ -23,6 +24,8 @@ class TestFancy:
|
|||
|
||||
total_linewrap = 12
|
||||
|
||||
with pytest.raises(JrnlError) as e:
|
||||
with pytest.raises(JrnlException) as e:
|
||||
check_provided_linewrap_viability(total_linewrap, [content], journal)
|
||||
assert e.value.error_type == "LineWrapTooSmallForDateFormat"
|
||||
assert (
|
||||
e.value.exception_msg == JrnlExceptionMessage.LineWrapTooSmallForDateFormat
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue