Skip to content

Commit

Permalink
fix: 'error' is of type 'unknown'
Browse files Browse the repository at this point in the history
  • Loading branch information
shakkernerd committed Nov 29, 2024
1 parent 55704df commit abeeaf6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/plugin-whatsapp/src/handlers/webhook.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ export class WebhookHandler {
await this.handleStatus(status);
}
}
} catch (error) {
throw new Error(`Failed to handle webhook event: ${error.message}`);
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(
`Failed to send WhatsApp message: ${error.message}`
);
}
throw new Error("Failed to send WhatsApp message");
}
}

Expand Down

0 comments on commit abeeaf6

Please sign in to comment.