ocebuild.errors#
Error instrospection and handling utilities.
Submodules#
Package Contents#
Functions#
| 
 | Suppresses stack trace information from an exception. | 
| 
 | Hides internal stackframes with an optional stylized stack trace. | 
- ocebuild.errors.disable_exception_traceback(tracebacklimit: int = 0)[source]#
- Suppresses stack trace information from an exception. - Parameters:
- tracebacklimit – The number of stack frames to show. Defaults to 0. 
 - Example - >>> with disable_exception_traceback(): ... raise Exception('This exception will not show a stack trace.') # -> Exception: This exception will not show a stack trace. 
- ocebuild.errors.wrap_exception(suppress: List[str] | None = None, suppress_internal: bool = True, suppress_stdlib: bool = False, hide_modules: List[types.ModuleType] | None = None, hide_suppressed: bool = True, hide_locals: bool = True, max_frames: int = 100, use_rich: bool = False)[source]#
- Hides internal stackframes with an optional stylized stack trace. - Parameters:
- suppress – A list of paths to suppress from the stack trace. 
- suppress_internal – Whether to suppress internal frames (default: True). 
- suppress_stdlib – Whether to suppress standard library frames (default: False). 
- hide_modules – A list of modules to hide from the stack trace. 
- hide_suppressed – Whether to hide suppressed frames (default: True). 
- hide_locals – Whether to hide local variables (default: True). 
- max_frames – The maximum number of frames to show (default: 100). 
- use_rich – Whether to use rich to display the stack trace (default: False). 
 
 - Example - >>> try: ... raise Exception('This exception will not show internal frames.') ... except Exception: ... wrap_exception() # -> Exception: This exception will not show internal frames.