class documentation

class ErrorWatcher: (source)

View In Hierarchy

Context manager that can be used to keep track of new errors recorded around a given operation. Errors maintain a stack of such watchers. The handler is called starting at the top of the stack, and is propagated down the stack unless filtered out by one of the ErrorWatcher instances.

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method filtered_errors Undocumented
Method has_new_errors Undocumented
Method on_error Handler called when a new error is recorded.
Instance Variable errors Undocumented
Instance Variable _filter Undocumented
Instance Variable _filtered Undocumented
Instance Variable _has_new_errors Undocumented
def __enter__(self) -> ErrorWatcher: (source)

Undocumented

def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> Literal[False]: (source)

Undocumented

def __init__(self, errors: Errors, *, filter_errors: bool|Callable[[str, ErrorInfo], bool] = False, save_filtered_errors: bool = False): (source)

Undocumented

def filtered_errors(self) -> list[ErrorInfo]: (source)

Undocumented

def has_new_errors(self) -> bool: (source)

Undocumented

def on_error(self, file: str, info: ErrorInfo) -> bool: (source)

Handler called when a new error is recorded. The default implementation just sets the has_new_errors flag Return True to filter out the error, preventing it from being seen by other ErrorWatcher further down the stack and from being recorded by Errors

Undocumented

Undocumented

Undocumented

_has_new_errors: bool = (source)

Undocumented