Skip to content

Commit 5e9533e

Browse files
committed
Format the deployment error so it gets displayed
1 parent 2bc26c8 commit 5e9533e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,20 @@ export class CreateDeployedBackgroundWorkerService extends BaseService {
6464
this._prisma
6565
);
6666
} catch (error) {
67+
const name = error instanceof Error ? error.name : "UnknownError";
68+
const message = error instanceof Error ? error.message : JSON.stringify(error);
69+
6770
await this._prisma.workerDeployment.update({
6871
where: {
6972
id: deployment.id,
7073
},
7174
data: {
7275
status: "FAILED",
7376
failedAt: new Date(),
74-
errorData: error instanceof Error ? error.message : JSON.stringify(error),
77+
errorData: {
78+
name,
79+
message,
80+
},
7581
},
7682
});
7783

0 commit comments

Comments
 (0)