Skip to content
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

fix: sync webhooks return error status now #3370

Merged
merged 1 commit into from Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/backend/src/app/webhooks/webhook-controller.ts
Expand Up @@ -168,13 +168,13 @@ const handleExecutionOutputStatus = async (run: FlowRun, reply: FastifyReply): P
await reply.status(StatusCodes.INTERNAL_SERVER_ERROR).send()
break
case ExecutionOutputStatus.FAILED:
await reply.status(StatusCodes.BAD_REQUEST).send({
await reply.status(StatusCodes.INTERNAL_SERVER_ERROR).send({
message: 'The flow has failed and there is no response returned',
})
break
case ExecutionOutputStatus.TIMEOUT:
case ExecutionOutputStatus.RUNNING:
await reply.status(StatusCodes.REQUEST_TIMEOUT).send({
await reply.status(StatusCodes.GATEWAY_TIMEOUT).send({
message: `The request took more than ${Math.floor(POLLING_TIMEOUT_MS / 1000)} seconds`,
})
break
Expand Down