fix: include JSON parse error details - #4408
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughIn ChangesRicher JSON parse error message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
Confidence Score: 5/5The change is a one-line message enrichment in the default JSON error path; it cannot affect routing, provider dispatch, or streaming behavior. The fix is narrowly scoped: only the user-visible error message string changes, the HTTP status code and connection-close behaviour remain identical. The existing error is still stored in the BifrostError.Error field unchanged, and the new message simply prepends "Invalid JSON: " to the already-wrapped sonic error string. No control-flow, auth, or data-handling paths are touched. Tests cover both the generic and GenAI unmarshal code paths. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "[fix]: transports - include JSON parse e..." | Re-trigger Greptile |
The merge-base changed after approval.
5018d9b to
35c0a70
Compare
35c0a70 to
2d17a58
Compare
2d17a58 to
0de50da
Compare
fa15f50 to
ca190fc
Compare
ac30a53 to
7c66b20
Compare
Fixes #3468.
Summary
Invalid JSON.Tests
GOWORK=/tmp/bifrost-go-work.<tmp> go test ./transports/bifrost-http/integrations -run 'TestCreateHandler_(GenAIUnmarshalErrorIncludesSchemaDetail|DefaultJSONParserFailureClosesConnection|CustomParserFailureClosesConnection|SkipsRequestParserInLargePayloadMode|UsesRequestParserWhenNotInLargePayloadMode)' -count=1\n-git diff --check\n\nNote: this is a clean, rebased replacement for fix: return bad request for schema parse errors #3493, which had picked up unrelated commits during the earlier rebase.