Handle JsonSchemaRequestException as 400 Bad Request in ThrowableHandler - #189
Handle JsonSchemaRequestException as 400 Bad Request in ThrowableHandler#189koriym wants to merge 1 commit into
Conversation
Raise the minimum bear/resource requirement to ^1.33 which introduces JsonSchemaRequestException / JsonSchemaResponseException. In ThrowableHandler, normalise JsonSchemaRequestException into BadRequestException (code 400) so VndError emits the correct 4xx status instead of falling through to 500. JsonSchemaResponseException (server-side schema mismatch) is unchanged and continues to produce a 500. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #189 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 52 53 +1
===========================================
Files 18 18
Lines 131 125 -6
===========================================
- Hits 131 125 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
bear/resourcerequirement from^1.16to^1.33ThrowableHandler::handle(), convertJsonSchemaRequestExceptiontoBadRequestException(code 400) soVndErroremits the correct 4xx response instead of the generic 500JsonSchemaResponseException(server-side schema mismatch) continues to produce a 500 — no change neededTest plan
testJsonSchemaRequestException→ 400 withapplication/vnd.error+jsontestJsonSchemaResponseException→ 500testException(404) andtestError(PHP Error → 500) still pass🤖 Generated with Claude Code