Skip to content

Misc fixes related to error display #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/sweet-spies-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"trigger.dev": patch
"@trigger.dev/core": patch
---

Correctly display errors on attempts and during indexing
3 changes: 2 additions & 1 deletion apps/webapp/app/v3/services/crashTaskRun.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class CrashTaskRunService extends BaseService {
event: event,
crashedAt: opts.crashedAt,
exception: {
type: "Worker crashed",
type: opts.errorCode ?? "TASK_RUN_CRASHED",
message: opts.reason,
stacktrace: opts.logs,
},
Expand All @@ -119,6 +119,7 @@ export class CrashTaskRunService extends BaseService {
{
reason: opts.reason,
logs: opts.logs,
code: opts.errorCode,
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-v3/src/entryPoints/deploy-index-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function indexDeployment({
const $env = await cliApiClient.getEnvironmentVariables(projectRef);

if (!$env.success) {
throw new Error(`Failed to fetch environment variables: ${env.error}`);
throw new Error(`Failed to fetch environment variables: ${$env.error}`);
}

const workerManifest = await indexWorkerManifest({
Expand Down
6 changes: 0 additions & 6 deletions packages/cli-v3/src/entryPoints/deploy-run-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,6 @@ class ProdWorker {
error,
});

try {
await this._taskRunProcess.cancel();
} catch (error) {
logger.error("Failed to cancel task run process", { error });
}

try {
await this.#submitAttemptCompletion(execution, {
id: execution.run.id,
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/v3/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ export function exceptionEventEnhancer(
}
break;
}
case TaskRunErrorCodes.TASK_PROCESS_MAYBE_OOM_KILLED:
case TaskRunErrorCodes.TASK_PROCESS_OOM_KILLED: {
return {
...exception,
...prettyInternalErrors[exception.type],
};
}
}

return exception;
Expand Down
Loading