Skip to content

Commit

Permalink
small error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Nov 29, 2024
1 parent a49e30b commit 293cfca
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/plugin-whatsapp/src/handlers/message.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ export class MessageHandler {
try {
const response = await this.client.sendMessage(message);
return response.data;
} catch (error) {
throw new Error(
`Failed to send WhatsApp message: ${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');
}
}
}
Loading

0 comments on commit 293cfca

Please sign in to comment.