Skip to content

Commit

Permalink
small error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune authored and shakkernerd committed Nov 29, 2024
1 parent 8635f75 commit 55704df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 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');
}
}
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55704df

Please sign in to comment.