excepthook
custom_excepthook(*args)
¶
CLI support. Sets an exception hook, so that if an exception is raised, if it's a user exception, then the traceback will only be the inner cause, not the outer frames.
Source code in lineapy/exceptions/excepthook.py
39 40 41 42 43 44 45 | |
set_custom_excepthook()
¶
To support CLI error reporting (or the repl, which we do not currently have).
Source code in lineapy/exceptions/excepthook.py
48 49 50 51 52 53 | |
transform_except_hook_args(args, *changes)
¶
Used by both CLI and Jupyter to pull out the cause from a user exception
and also apply the changes to the frames if it's a UserException, which
is a custom exception that WE created.
changes is for Jupyter notebook support. They were discovered through trial and error with different type
of executions, as seen in executor.py.
If the error is from lineapy, we keep the original frames.
Source code in lineapy/exceptions/excepthook.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |