Errors
Term.Errors.StacktraceContext
Term.Errors.add_new_module_name!
Term.Errors.add_number_frames_skipped!
Term.Errors.add_stack_frame!
Term.Errors.add_stack_frame!
Term.Errors.frame_module
Term.Errors.frame_module
Term.Errors.frame_module
Term.Errors.get_frame_function_name
Term.Errors.install_term_stacktrace
Term.Errors.parse_kw_func_name
Term.Errors.render_backtrace
Term.Errors.render_error_code_line
Term.Errors.should_skip
Term.Errors.StacktraceContext
— TypeStores information useful for creating the layout of a stack trace visualization.
Term.Errors.add_new_module_name!
— Methodadd_new_module_name!(content, ctx::StacktraceContext, curr_modul)
When a frame belonging to a module different from the previous one is shown, print the new module's name.
Term.Errors.add_number_frames_skipped!
— Methodadd_number_frames_skipped!(content, ctx, to_skip, num, bt, n_skipped, skipped_frames_modules)
Add some text explaining how many frames were skipped from the stacktrace visualization and to which modules they belonged.
Term.Errors.add_stack_frame!
— Functionfunction add_stack_frame! end
Create a Term visualization of info and metadata about a stacktrace frame.
Term.Errors.add_stack_frame!
— Methodadd_stack_frame!(frame::StackFrame, ctx::StacktraceContext, num::Int; kwargs...)
Renders a panel with:
- frame number
- function name/signature
- source code at error line
Term.Errors.frame_module
— Methodfunction frame_module end
Get the Module a function is defined in, as a string
Term.Errors.frame_module
— MethodGet module for a pointer obj
Term.Errors.frame_module
— MethodGet module from file path.
Term.Errors.get_frame_function_name
— Methodget_frame_function_name
Get and stylize a function's name/signature
Term.Errors.install_term_stacktrace
— Methodinstall_term_stacktrace(; reverse_backtrace::Bool = true, max_n_frames::Int = 30)
Replace the default Julia stacktrace error stacktrace printing with Term's.
Term parses a StackTrace
adding additional info and style before printing it out to the user. The printed output consists of two parts: - a list of "frames": nested code points showing where the error occurred, the "Error Stack" - a message: generally the standard info message given by Julia but with addintional formatting option.
Several options are provided to reverse the order in which the frames are shown (compared to Julia's default ordering), hide extra frames when a large number is in the trace (e.g. Stack Overflow error) and hide Base and standard libraries error information (i.e. when a frame is in a module belonging to those.)
Term.Errors.parse_kw_func_name
— Methodparse_kw_func_name(frame::StackFrame)
Kw function calls have a weird name, parse arguments to get a proper function signature.
Term.Errors.render_backtrace
— Methodrender_backtrace(bt::Vector; reverse_backtrace = true, max_n_frames = 30)
Main error backtrace rendering function. It renders each frame in a stacktrace after some filtering (e.g. to hide frames in BASE). It takes care of hiding frames when there's a large number of them.
Term.Errors.render_error_code_line
— Methodrender_error_code_line(frame::StackFrame; δ=2)
Create a Panel
showing formatted Julia code for a frame's error line. The parameter δ
speciies how many lines above/below the error line to show.
Term.Errors.should_skip
— Methodshould_skip
A frame should skip if it's in Base or an installed package.