Skip to main content

get_traceback

Generates a formatted Traceback object from an exception using the provided configuration and directory suppression list.

def get_traceback(
exc: BaseException,
exception_config: DeveloperExceptionConfig,
internal_dir_names: list[str]
) - > Traceback

Generates a formatted Rich traceback object from an exception to provide a human-readable diagnostic view of errors.

Parameters

NameTypeDescription
excBaseExceptionThe exception instance to be processed into a traceback.
exception_configDeveloperExceptionConfigConfiguration object that determines whether to display local variables within the traceback frames.
internal_dir_nameslist[str]A list of directory paths or module names to be suppressed and hidden from the traceback output to reduce noise.

Returns

TypeDescription
TracebackA Rich Traceback object configured with local variable visibility and suppressed internal frames for clean terminal output.