Skip to content

Commit 58f0eda

Browse files
hubyrodclaude
andcommitted
Improve webhook parse error logging with event type, error, and body preview
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d8261e2 commit 58f0eda

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ async function handleWebhook(req: Request, groupId: string): Promise<Response> {
5959
let payload: { action?: string };
6060
try {
6161
payload = JSON.parse(body);
62-
} catch {
63-
log("error", "Failed to parse webhook payload");
62+
} catch (err) {
63+
log("error", `Failed to parse ${eventType} payload: ${err}. Body: ${body.slice(0, 200)}`);
6464
return new Response("OK");
6565
}
6666

0 commit comments

Comments
 (0)