fix: log HTTP response body on error in all integration clients - #66
Conversation
…-catch 1. timeline.ts: apply branched SQL query pattern (matching mcp.ts fix) 2. mcp.ts get_case_timeline: wrap evidence fetch in try-catch, add warnings/partial fields for degraded responses 3. integrations.ts: searchEntries/getChainOfCustody now return ServiceArrayResult<T> with explicit error field so callers can distinguish "no data" from "service unreachable" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All 16 `!res.ok` branches across ledger, evidence, finance, charge, connect, mercury, books, assets, scrape, and router clients now capture and log the response body (truncated to 500 chars). This surfaces upstream error messages (auth failures, validation errors, rate limits) that were previously silently dropped. Plaid and Notion clients already had this pattern and were not changed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChanges improve error handling and response consistency across service clients. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
To use Codex here, create a Codex account and connect to github. |
Summary
!res.okbranches across integration clients now log the upstream response body (truncated to 500 chars)const body = await res.text().catch(() => ''); console.error(...)Why
A 401 with
{"error":"invalid token"}previously looked identical to a 500 or DNS failure in logs. This makes auth misconfigs, rate limits, and validation errors immediately diagnosable.Test plan
npx tsc --noEmitpasses (verified locally)🤖 Generated with Claude Code
Summary by CodeRabbit