fix(routes): truncate error details in non-production responses#175
fix(routes): truncate error details in non-production responses#1756figpsolseeker wants to merge 1 commit intodcccrypto:mainfrom
Conversation
insurance.ts, open-interest.ts, and stats.ts exposed untruncated error messages in non-production 500 responses via the `details` field. While gated on NODE_ENV !== "production", raw error messages can contain internal file paths, DB connection strings, or stack traces that aid reconnaissance in staging/dev environments shared with external testers. Wrap with truncateErrorMessage(..., 200) to match the pattern already used by funding.ts and the logger calls in the same catch blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThree API route error handlers updated to increase error message truncation limits from 120 to 200 characters in non-production environments, or to apply truncation where previously untruncated, maintaining existing HTTP status codes and control flow logic. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
Test plan
Summary by CodeRabbit