Skip to content

Commit a0c7592

Browse files
committed
Set the final error on the task run if it exists
1 parent 021efa3 commit a0c7592

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

apps/webapp/app/v3/services/finalizeTaskRun.server.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class FinalizeTaskRunService extends BaseService {
6666
await this.finalizeAttempt({ attemptStatus, error, run });
6767
}
6868

69-
if (isFailedRunStatus(run.status)) {
69+
if (error) {
7070
await this.finalizeRunError(run, error);
7171
}
7272

@@ -88,11 +88,7 @@ export class FinalizeTaskRunService extends BaseService {
8888
return run as Output<T>;
8989
}
9090

91-
async finalizeRunError(run: TaskRun, error?: TaskRunError) {
92-
if (!error) {
93-
return;
94-
}
95-
91+
async finalizeRunError(run: TaskRun, error: TaskRunError) {
9692
await this._prisma.taskRun.update({
9793
where: { id: run.id },
9894
data: {

0 commit comments

Comments
 (0)