Skip to content

Commit

Permalink
websites-integration: maybe errors aren't serializable or cyclic...?
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Jun 7, 2024
1 parent 12e7bbd commit 930ef7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export const onRequestPost: PagesFunction<Env, 'id'> = async (context) => {
return json(
{
id: paramId,
message: 'Callback failed, perhaps the deployment has already finished',
error,
message: 'Callback failed, perhaps the deployment has already been finished',
},
{ status: 400 },
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export const onRequestGet: PagesFunction<Env, 'id'> = async (context) => {
state = await stub.getCurrentState();
} catch (error) {
console.error(error);

// @ts-ignore
return json({ id: paramId, message: 'Invalid state', error }, { status: 500 });
return json({ id: paramId, message: 'Invalid state' }, { status: 500 });
}

if (state.type === 'DONE' && state.artifactName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export const onRequestGet: PagesFunction<Env, 'id'> = async (context) => {
return json({ id: paramId, state });
} catch (error) {
console.error(error);

return json({ id: paramId, message: 'Invalid state', error }, { status: 500 });
return json({ id: paramId, message: 'Invalid state' }, { status: 500 });
}
};

Expand Down Expand Up @@ -55,9 +54,8 @@ export const onRequestPost: PagesFunction<Env, 'id'> = async (context) => {
return json({ id: paramId, run_id: params.run_id, message: 'Job is successfully bound' });
} catch (error) {
console.error(error);

return json(
{ id: paramId, run_id: params.run_id, message: 'Failed to bind job', error },
{ id: paramId, run_id: params.run_id, message: 'Failed to bind job' },
{ status: 500 },
);
}
Expand Down
4 changes: 1 addition & 3 deletions _workers/websites-integration/functions/deployments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const onRequestPost: PagesFunction<Env> = async (context) => {
});
} catch (err) {
console.error(err);

// @ts-ignore
return json({ message: err?.message || err.toString() }, { status: 500 });
return json({ message: 'Failed to initialize a deployment' }, { status: 500 });
}
};

0 comments on commit 930ef7d

Please sign in to comment.