feat: add the WORKER_TIMEOUT error code to the generated catalogue
Why
The Infrahub server now returns a WORKER_TIMEOUT error code when a call to a worker runs past its timeout (opsmill/infrahub#10668, part of opsmill/infrahub#10530). The SDK's generated error catalogue does not have this code yet, so the Infrahub backend-validate-generated CI job fails on opsmill/infrahub#10530 with python_sdk/infrahub_sdk/exceptions/catalogue.py is out of date with schema/error-catalogue.json.
What changed
- Regenerated
infrahub_sdk/exceptions/catalogue.pyfrom the server's error catalogue withuv run invoke backend.generate. - Added
WorkerTimeoutDataandWorkerTimeoutError, and registeredWORKER_TIMEOUTinCODE_TO_EXCEPTION,CODE_TO_DATA_MODELand the builder mapping. - Exported
WorkerTimeoutErrorfrominfrahub_sdk.exceptionsand added it to thepublic_names.jsonsnapshot. - Added a
WORKER_TIMEOUTcase to the per-code tests intests/unit/sdk/test_error_catalogue.py, with a captured response intests/fixtures/error_catalogue/codes/worker_timeout.json. - The other catalogue entries are unchanged.
How to review
catalogue.py is generated. Review it against the WORKER_TIMEOUT entry in schema/error-catalogue.json on opsmill/infrahub#10530. The fixture uses the payload and message the server builds for a connectivity check that times out.
How to test
uv run pytest tests/unit/sdk/test_error_catalogue.py tests/unit/sdk/test_exceptions_public_names.py
Once the Infrahub PR points its python_sdk submodule at this branch, its backend-validate-generated job should pass.
Checklist
- Tests added/updated
- Changelog entry added: not needed, because the error catalogue has not been released and
+typed-per-code-exceptions.added.mdalready covers it - External docs updated (if user-facing or ops-facing change)
- Internal .md docs updated (internal knowledge and AI code tools knowledge)