OUT-3598: surface Dropbox 409 reasons in Sentry titles#102
Conversation
Sentry uses Error.message for issue titles, so the error_summary we already pull from the content-endpoint response body was invisible there — every 409/4xx in DROPBOX-INTEGRATION-17 surfaced as opaque "Response failed with a 4xx code". Append the parsed error_summary to the constructed DropboxResponseError's .message so Sentry titles read e.g. "Response failed with a 409 code: path/not_found/..".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR closes the last-mile observability gap for Dropbox content-endpoint errors by embedding Dropbox's
Confidence Score: 4/5Safe to merge for the targeted 409 Sentry-title improvement; the only rough edge is in the non-JSON fallback path, which is unlikely to fire for the 409 case this PR is fixing. The change is tightly scoped: one method, one new assignment to src/lib/dropbox/DropboxClient.ts — specifically the fallback branch in Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller as _downloadFile / _uploadFile
participant BDRB as buildDropboxResponseError
participant DBX as Dropbox API
participant Sentry
Caller->>DBX: manualFetch(url, headers)
DBX-->>Caller: response (non-200)
Caller->>BDRB: buildDropboxResponseError(response, fallbackSummary)
BDRB->>DBX: response.text()
DBX-->>BDRB: rawBody
Note over BDRB: Parse JSON → errorPayload
BDRB->>BDRB: new DropboxResponseError(status, headers, errorPayload)
BDRB->>BDRB: Extract error_summary string
BDRB->>BDRB: "(err as Error).message = message + summary"
BDRB-->>Caller: DropboxResponseError (enriched .message)
Caller-->>Sentry: "throw err → Sentry title = err.message"
Reviews (1): Last reviewed commit: "fix(OUT-3598): embed Dropbox error_summa..." | Re-trigger Greptile |
When the Dropbox content endpoint returns a non-JSON response body (e.g. a 5xx HTML page from an upstream proxy/gateway), the fallback path puts the entire raw body into error_summary — which previously ended up verbatim in Error.message and the Sentry title. Slice at 200 chars when embedding into .message; full body remains available on err.error.error_summary for structured logs.
Summary
DROPBOX-INTEGRATION-17:DropboxClient.buildDropboxResponseErrornow embeds Dropbox'serror_summaryinto the constructedDropboxResponseError's runtime.message, so Sentry titles read e.g.Response failed with a 409 code: path/not_found/..instead of opaqueResponse failed with a 409 code.error_summarydata from the next occurrence before deciding on any per-reason handling.Why
Earlier OUT-3598 commits (
0426a12,dcce588) already parse Dropbox's response body and put theerror_summaryon the error payload — but Sentry usesError.messagefor issue titles, so the parsed reason was invisible there. This final commit mutates.messagepost-construction so the reason rides through to Sentry's title.Test plan
DROPBOX-INTEGRATION-17event in Sentry and confirm the title now contains the Dropbox reason (e.g.path/not_found/..).Out of scope (tracked separately)
src/utils/withErrorHandler.ts:51-54has a mirror branch-ordering bug (instanceof Errorshadowsinstanceof DropboxResponseError) that affects API route responses — not the Sentry path. To be addressed in its own ticket.path/not_found, mark-failed onrestricted_content, etc.) — explicitly deferred until real data lands.Linear: https://linear.app/assemblycom/issue/OUT-3598/dropboxresponseerror-response-failed-with-a-409-code
🤖 Generated with Claude Code