feat: add SourceNotConfiguredError and the governance backend reason

Pure addition ahead of the reparenting, so this commit leaves every
existing caller and test untouched.

SourceNotConfiguredError deliberately stays outside GatewayUnavailableError:
a source name that is not in the limiter's config dict is an assembly
defect, not a transient outage, and folding it into the retryable family
would let a typo retry forever without ever reaching a dead letter queue.

The retry_after_s default is 5.0 rather than 0 because a backlog released
at zero delay would stampede a backend that is already down.
This commit is contained in:
2026-08-06 04:36:46 -04:00
parent c634cab35e
commit dd540496a1
3 changed files with 62 additions and 1 deletions
+2
View File
@@ -17,6 +17,7 @@ from polygateway.errors import (
RequestRejectedError,
ResultInvalidError,
SourceDeadError,
SourceNotConfiguredError,
TransientError,
)
from polygateway.ocr import OcrClient
@@ -58,6 +59,7 @@ __all__ = [
"ResultInvalidError",
"SourceConfig",
"SourceDeadError",
"SourceNotConfiguredError",
"TransientError",
"__version__",
"gather_bounded",