Skip to content

Distinguish a client error from a server failure. - #3

Merged
gustavofreze merged 2 commits into
mainfrom
feat/client-error-fallback
Jul 29, 2026
Merged

Distinguish a client error from a server failure.#3
gustavofreze merged 2 commits into
mainfrom
feat/client-error-fallback

Conversation

@gustavofreze

Copy link
Copy Markdown
Member

Please follow the contributing guidelines.

Summary

What this pull request does.

Related issue

Closes #...

Checklist

  • Tests added or updated.
  • Documentation updated when applicable.
  • composer review passes.
  • composer tests passes.

An unmapped exception was always answered with a generic 500, which told
a caller that mistyped a URL that the server had failed, and kept a
client that retries on 5xx retrying a request that can never succeed.
The routing exceptions a PSR-15 stack raises already carry the status,
so the fallback now adopts it when it is a client error and keeps the
generic 500 for everything else.

The log level follows the same distinction and derives from the status
actually returned, so a validation failure a consumer maps to 422 stops
inflating every error-rate signal built on top of the logs.
@gustavofreze
gustavofreze merged commit 5c26e96 into main Jul 29, 2026
7 checks passed
@gustavofreze
gustavofreze deleted the feat/client-error-fallback branch July 29, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant