Skip to content

Rewrite v7 exceptions page for problem details - #170

Merged
arhimede merged 1 commit into
mainfrom
exceptions-problem-details-rewrite
Sep 8, 2026
Merged

Rewrite v7 exceptions page for problem details#170
arhimede merged 1 commit into
mainfrom
exceptions-problem-details-rewrite

Conversation

@arhimede

@arhimede arhimede commented Sep 7, 2026

Copy link
Copy Markdown
Member

The "How to extend" walkthrough taught a model the application no longer has: create a plain Exception, then add a catch block to HandlerTrait::handle() returning $this->errorResponse(). That directory, trait and helper do not exist, and neither do MethodNotAllowedException or OutOfBoundsException.

Every exception now implements ProblemDetailsExceptionInterface and sets its own status inside a static create() factory, so extending is one new class and nothing else. The walkthrough builds a TeapotException and shows the 418 document it produces.

Also documents the ten real exceptions with the status each one sets and what raises it, the four create() arguments and their fallbacks, the two paths ProblemDetailsMiddleware takes, and the fact that 404 and 405 come from router middleware rather than application exceptions.

Verified against dotkernel/api at 7.0, commit 45ad282.

Fixes C6 of the v7 documentation audit.

The extend walkthrough named paths, a trait and a helper that no longer
exist; documents the ten real exceptions and the ::create() factory.

Signed-off-by: arhimede <julian@dotkernel.com>
@arhimede
arhimede merged commit a86d4a6 into main Sep 8, 2026
10 checks passed
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.

2 participants