Report exceptions from Micropub 500 error paths instead of swallowing them #136
Loading…
Reference in a new issue
No description provided.
Delete branch "log-micropub-controller-errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
MicropubController::post()had a catch-all that returned a generic 500 without ever callingreport(), so failures never reachedlaravel.logor Flare (Flare is already wired up viabootstrap/app.php).\Exceptionto\Throwableso PHP Errors (e.g.TypeError) get the same Micropub-shaped JSON error response and are also reported.MicropubUnsupportedModelException,MicropubHandlerException) now report too.Triggered by a real incident: a Micropub POST returned a 500 with nothing in
laravel.logand nothing in Flare. Traced it to this swallowed exception - the response body was exactly 87 bytes, matching the nginx access log's byte count for that request.Test plan
./vendor/bin/sail test --filter=MicropubControllerTest- 41 passed, including a new assertion thatreport()is invoked on theMicropubHandlerException500 path./vendor/bin/sail test- full suite, 377 passed./vendor/bin/pint --test- clean🤖 Generated with Claude Code