Skip to content

Commit d583709

Browse files
authored
Merge pull request #2159 from dubinc/fix-webhook-logs
Update webhook error handling to account for status -1
2 parents 773c075 + d47ec86 commit d583709

File tree

1 file changed

+2
-2
lines changed
  • apps/web/app/api/webhooks/callback

1 file changed

+2
-2
lines changed

apps/web/app/api/webhooks/callback/route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const POST = async (req: Request) => {
3939

4040
const request = Buffer.from(sourceBody, "base64").toString("utf-8");
4141
const response = Buffer.from(body, "base64").toString("utf-8");
42-
const isFailed = status >= 400;
42+
const isFailed = status >= 400 || status === -1;
4343

4444
// Unsubscribe Zapier webhook
4545
if (
@@ -62,7 +62,7 @@ export const POST = async (req: Request) => {
6262
url,
6363
event,
6464
event_id: eventId,
65-
http_status: status,
65+
http_status: status === -1 ? 503 : status,
6666
webhook_id: webhookId,
6767
request_body: request,
6868
response_body: response,

0 commit comments

Comments
 (0)