mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
update uncaught exception for new handling
This commit is contained in:
parent
d863d217a0
commit
691546588c
2 changed files with 12 additions and 7 deletions
17
jrnl/cli.py
17
jrnl/cli.py
|
@ -7,9 +7,12 @@ import traceback
|
||||||
|
|
||||||
from .jrnl import run
|
from .jrnl import run
|
||||||
from .args import parse_args
|
from .args import parse_args
|
||||||
from .exception import JrnlException
|
|
||||||
from jrnl.output import print_msg
|
from jrnl.output import print_msg
|
||||||
from jrnl.output import Message
|
|
||||||
|
from jrnl.exception import JrnlException
|
||||||
|
from jrnl.messages import Message
|
||||||
|
from jrnl.messages import MsgText
|
||||||
|
from jrnl.messages import MsgType
|
||||||
|
|
||||||
|
|
||||||
def configure_logger(debug=False):
|
def configure_logger(debug=False):
|
||||||
|
@ -61,11 +64,13 @@ def cli(manual_args=None):
|
||||||
print("\n")
|
print("\n")
|
||||||
traceback.print_tb(sys.exc_info()[2])
|
traceback.print_tb(sys.exc_info()[2])
|
||||||
|
|
||||||
file_issue = (
|
print_msg(
|
||||||
"\n\nThis is probably a bug. Please file an issue at:"
|
Message(
|
||||||
+ "\nhttps://github.com/jrnl-org/jrnl/issues/new/choose"
|
MsgText.UncaughtException,
|
||||||
|
MsgType.ERROR,
|
||||||
|
{"name": type(e).__name__, "exception": e},
|
||||||
|
)
|
||||||
)
|
)
|
||||||
print_msg(f"{type(e).__name__}\n", f"{e}{file_issue}", msg=Message.ERROR)
|
|
||||||
|
|
||||||
# This should be the only exit point
|
# This should be the only exit point
|
||||||
return status_code
|
return status_code
|
||||||
|
|
|
@ -26,7 +26,7 @@ class MsgText(Enum):
|
||||||
|
|
||||||
# --- Exceptions ---#
|
# --- Exceptions ---#
|
||||||
UncaughtException = """
|
UncaughtException = """
|
||||||
ERROR
|
{name}
|
||||||
{exception}
|
{exception}
|
||||||
|
|
||||||
This is probably a bug. Please file an issue at:
|
This is probably a bug. Please file an issue at:
|
||||||
|
|
Loading…
Add table
Reference in a new issue