pkgcore.bugzilla.errors module

Exceptions raised by pkgcore.bugzilla.

Bugzilla reports failures as a JSON body {“error”: true, “code”: N, “message”: …}, and derives the HTTP status from the code through a lossy table. Dispatch on the code, not the status: an invalid api key is code 306 delivered as HTTP 400, permission denied is code 102 delivered as HTTP 401, and bugs.gentoo.org never emits 403 at all.

exception pkgcore.bugzilla.errors.BugzillaAuthError(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaResponseError

Authentication failed, or the request requires being logged in

exception pkgcore.bugzilla.errors.BugzillaAuthRequired(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaAuthError

A write was attempted without an api key, raised without a round trip

exception pkgcore.bugzilla.errors.BugzillaConnectionError(msg, verbosity=None)[source]

Bases: BugzillaError

DNS, TCP, TLS or timeout failure, after any retries were exhausted

exception pkgcore.bugzilla.errors.BugzillaError(msg, verbosity=None)[source]

Bases: PkgcoreUserException

Base for every failure raised by pkgcore.bugzilla

exception pkgcore.bugzilla.errors.BugzillaInvalidField(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaResponseError

A field name or value was rejected

exception pkgcore.bugzilla.errors.BugzillaNotFound(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaResponseError

The requested bug, comment or REST route doesn’t exist

exception pkgcore.bugzilla.errors.BugzillaPermissionDenied(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaResponseError

The account is known but isn’t allowed to see or change this

exception pkgcore.bugzilla.errors.BugzillaProtocolError(msg, verbosity=None)[source]

Bases: BugzillaError

The server answered with something that isn’t a Bugzilla REST reply

exception pkgcore.bugzilla.errors.BugzillaResponseError(message: str, *, code: int = 0, status: int = 0, url: str = '')[source]

Bases: BugzillaError

Bugzilla returned an error body

exception pkgcore.bugzilla.errors.BugzillaSchemaError(msg, verbosity=None)[source]

Bases: BugzillaProtocolError

Valid JSON, but not the shape the endpoint documents

exception pkgcore.bugzilla.errors.BugzillaServerError(message: str, *, retry_after: float | None = None, **kwargs: Any)[source]

Bases: BugzillaResponseError

A 5xx from the web tier in front of Bugzilla

exception pkgcore.bugzilla.errors.BugzillaUsageError(msg, verbosity=None)[source]

Bases: BugzillaError, ValueError

The request couldn’t be built, raised locally without any network use

exception pkgcore.bugzilla.errors.PackageListError(message: str, *, bug_id: int | None = None, lineno: int | None = None, line: str = '')[source]

Bases: BugzillaError

Malformed cf_stabilisation_atoms content

pkgcore.bugzilla.errors.from_response(error: Mapping[str, Any], status: int, url: str, retry_after: float | None = None) BugzillaResponseError[source]

Build the most specific exception for a Bugzilla error body

pkgcore.bugzilla.errors.from_status(status: int, url: str, payload: bytes = b'', retry_after: float | None = None) BugzillaResponseError[source]

Build an exception for a failing response that carried no error body