Module

utils.error_handlers

Context-aware error handlers to enrich exception displays.

Handlers provide concise, helpful suggestions for common Python errors:

  • ImportError: Show available exports in the target module and close matches
  • AttributeError: Show available attributes on a target module and close matches
  • TypeError: Generic guidance for common patterns

These handlers are best-effort and must never raise; they return lightweight strings suitable for inclusion in compact/minimal traceback renderers.

Classes

ContextAwareHelp dataclass
0

Attributes

Name Type Description
title str
lines list[str]

Functions

get_context_aware_help
1 ContextAwareHelp | None
def get_context_aware_help(error: BaseException) -> ContextAwareHelp | None

Parameters 1

Name Type Default Description
error BaseException

Returns

ContextAwareHelp | None