Source code for stdlibx.cancel._errors

 1from __future__ import annotations
 2
 3
[docs] 4class CancellationTokenError(Exception): 5 """Base class for all cancellation-related errors. Raised when a 6 cancellation event affects the current operation. Serves as the common 7 superclass for all token error types. 8 """
9 10
[docs] 11class CancellationTokenCancelledError(CancellationTokenError): 12 """Raised when an operation is cancelled via a cancellation token. This 13 exception indicates that the token was explicitly cancelled. 14 """
15 16
[docs] 17class CancellationTokenTimeoutError(CancellationTokenError): 18 """Raised when a token is cancelled due to a timeout. This exception 19 indicates that the token's cancellation was triggered by an internal 20 timeout mechanism (for example via :func:`stdlibx.cancel.with_timeout`). 21 """