Skip to content

Commit 402d974

Browse files
committed
Continue snapshot throw json
1 parent b8b83e3 commit 402d974

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/webapp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.snapshots.$snapshotFriendlyId.continue.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ export const loader = createLoaderWorkerApiRoute(
2727

2828
return json(continuationResult);
2929
} catch (error) {
30-
logger.error("Failed to suspend run", { runFriendlyId, snapshotFriendlyId, error });
31-
throw error;
30+
logger.warn("Failed to suspend run", { runFriendlyId, snapshotFriendlyId, error });
31+
if (error instanceof Error) {
32+
throw json({ error: error.message }, { status: 422 });
33+
}
34+
35+
throw json({ error: "Failed to continue run execution" }, { status: 422 });
3236
}
3337
}
3438
);

0 commit comments

Comments
 (0)