fix(web): remove provider name from gateway listener error messages

Error messages in sendMessageWhatsApp, sendReactionWhatsApp, and
sendPollWhatsApp included hardcoded \"WhatsApp\" references. This caused
confusion when cron jobs using other providers (e.g., Telegram) failed
with errors mentioning WhatsApp.

Changes error messages to be provider-agnostic while maintaining the
same error handling behavior.

Fixes #461
Fixes #470

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yurii Chukhlib
2026-01-09 22:39:52 +01:00
committed by Peter Steinberger
parent f4b9a00d37
commit a9f8719cd2

View File

@@ -29,7 +29,7 @@ export async function sendMessageWhatsApp(
const active = getActiveWebListener(options.accountId);
if (!active) {
throw new Error(
"No active gateway listener. Start the gateway before sending WhatsApp messages.",
"No active gateway listener. Start the gateway before sending messages.",
);
}
const logger = getChildLogger({
@@ -111,7 +111,7 @@ export async function sendReactionWhatsApp(
const active = getActiveWebListener(options.accountId);
if (!active) {
throw new Error(
"No active gateway listener. Start the gateway before sending WhatsApp reactions.",
"No active gateway listener. Start the gateway before sending reactions.",
);
}
const logger = getChildLogger({
@@ -152,7 +152,7 @@ export async function sendPollWhatsApp(
const active = getActiveWebListener(options.accountId);
if (!active) {
throw new Error(
"No active gateway listener. Start the gateway before sending WhatsApp polls.",
"No active gateway listener. Start the gateway before sending polls.",
);
}
const logger = getChildLogger({