Commit 0fb8631
authored
chore(runner): expose error.cause in http client (NangoHQ#5513)
Expose error cause when http request from runner is failing.
Right now we only report the parent error (`fetch failed`) which doesn't
give any details about why the request failed
<!-- Summary by @propel-code-bot -->
BEFORE
<img width="1017" height="714" alt="Screenshot 2026-02-24 at 13 56 40"
src="https://github.com/user-attachments/assets/a354bf29-0f03-4e75-a761-dcdf709ac56f"
/>
AFTER
<img width="1016" height="800" alt="Screenshot 2026-02-24 at 13 55 12"
src="https://github.com/user-attachments/assets/25f1fd7c-3751-485f-942a-01e1771f10c7"
/>
---
It introduces an optional cause-aware serialization path through
stringifyError so the runner’s HTTP client and report logger surface
nested failure details in responses and logs, with accompanying tests
ensuring the behavior.
<details>
<summary><strong>Key Changes</strong></summary>
• Extended `stringifyError` signature to accept `{ cause?: boolean }`
and only include the `cause` field when requested.
• Updated `report` in `packages/utils/lib/errors.ts` to log errors with
both stack traces and causes when Sentry is disabled.
• Modified `packages/runner/lib/clients/http.ts` to include serialized
`error.cause` in 502 responses returned after HTTP failures.
• Added a unit test ensuring `stringifyError` includes `cause` when the
new option is enabled.
</details>
<details>
<summary><strong>Possible Issues</strong></summary>
• `error.cause` may contain large or sensitive structures, so exposing
it externally could require additional filtering.
</details>
---
*This summary was automatically generated by @propel-code-bot*1 parent 5768b09 commit 0fb8631
3 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
| |||
0 commit comments