Exceptions

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 as message (key1: val1 | key2: val2).

Important

Each keyword in kwargs is also set as an instance attribute (see the loop below). This is load-bearing; multiple callers rely on getattr(err, "not_found", False) to short-circuit on 404 responses (notably patcher.clients.installomator.InstallomatorClient.match()). Removing the setattr loop in favor of “just storing kwargs in self.context” looks like cleanup but silently breaks the 404 short-circuit. The context dict is preserved separately for the message formatter.

Parameters:

message (str)

format_message() str[source]

Format exception message properly.

Return type:

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 TokenError(message: str = None, **kwargs)[source]

Raised when there is an error fetching, saving or retrieving a bearer token from Jamf API.

Parameters:

message (str)

exception InstallomatorWarning[source]

Custom warning to indicate InstallomatorClient-related issues.