Skip to content

Commit c672d33

Browse files
committed
fix(core): pretty link for TASK_RUN_UNCAUGHT_EXCEPTION
Adds a prettyInternalErrors entry pointing the dashboard at a troubleshooting doc anchor for uncaught exceptions. Link-only — no `message` override, so the customer's original error (e.g. "read ECONNRESET") is preserved as the main text. The link gives them somewhere to read about attaching .on("error") listeners and the unhandledRejection pathway. The docs anchor (#uncaught-exceptions) doesn't exist yet — needs a docs PR to add the troubleshooting section.
1 parent 3f70ec1 commit c672d33

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

packages/core/src/v3/errors.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,18 @@ const prettyInternalErrors: Partial<
724724
href: links.docs.troubleshooting.stalledExecution,
725725
},
726726
},
727+
// Link only — we deliberately do NOT set `message`, so the original
728+
// error message (e.g. "read ECONNRESET") is preserved in the dashboard.
729+
// Common cause: an EventEmitter (node-redis, pg, etc.) emitted "error"
730+
// with no listener attached, which Node escalates to uncaughtException.
731+
// The docs page explains how to attach .on("error") listeners and how
732+
// unhandled rejections route through the same path.
733+
TASK_RUN_UNCAUGHT_EXCEPTION: {
734+
link: {
735+
name: "Read our troubleshooting guide",
736+
href: links.docs.troubleshooting.uncaughtException,
737+
},
738+
},
727739
};
728740

729741
const getPrettyTaskRunError = (code: TaskRunInternalError["code"]): TaskRunInternalError => {

packages/core/src/v3/links.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const links = {
1515
troubleshooting: {
1616
concurrentWaits: "https://trigger.dev/docs/troubleshooting#parallel-waits-are-not-supported",
1717
stalledExecution: "https://trigger.dev/docs/troubleshooting#task-run-stalled-executing",
18+
uncaughtException: "https://trigger.dev/docs/troubleshooting#uncaught-exceptions",
1819
},
1920
concurrency: {
2021
recursiveDeadlock:

0 commit comments

Comments
 (0)