Centralized error handling

A step of the Cloud application tree on Gradus, in the Testing & resilience area: Tests, errors, SLOs.

Introduce typed errors and a centralized handler so failures are caught, logged and turned into consistent responses.

Usually comes after: Unit tests.

Leads to: Retries & circuit breakers.

Prompt for your AI assistant

Introduce a typed error hierarchy and a centralized error-handling middleware that catches unhandled exceptions and returns consistent, well-formed error responses.

This is https://gradus.kazet.blog/tree/cloud-application/step/error-handling as plain HTML. In a browser the page also lets you mark the step forged and copy a message for your AI assistant.