Exceptions#
Patcherโs exception hierarchy.
- exception PatcherError(message: str = None, **kwargs)[source]#
Base exception class for Patcher exceptions.
Carries arbitrary keyword context (e.g.
status_code=401,url=...,not_found=True) and renders it into the formatted message asmessage (key1: val1 | key2: val2).Important
Each keyword in
kwargsis also set as an instance attribute (see the loop below). This is load-bearing; multiple callers rely ongetattr(err, "not_found", False)to short-circuit on 404 responses (notably during Installomator label fetches). Removing thesetattrloop in favor of โjust storing kwargs inself.contextโ looks like cleanup but silently breaks the 404 short-circuit. The context dict is preserved separately for the message formatter.- Parameters:
message (str)
- exception SetupError(message: str = None, **kwargs)[source]#
Raised if any errors occur during automatic setup.
- Parameters:
message (str)
- exception CredentialError(message: str = None, **kwargs)[source]#
Raised if any errors occur during saving or updating credentials.
- Parameters:
message (str)
- exception APIResponseError(message: str = None, **kwargs)[source]#
Raised when an API Call receives an unsuccessful status code.
- Parameters:
message (str)
- exception NotFoundError(message: str = None, **kwargs)[source]#
Raised when an API call returns 404 (resource not found).
A subclass of
APIResponseError, so existingexcept APIResponseErrorhandlers still catch it; new code canexcept NotFoundErrorfor the 404 case. Always carriesnot_found=Trueso the legacygetattr(err, "not_found", ...)short-circuit keeps working.- Parameters:
message (str)