fix(whatsapp.gblib): Fixed check status.

This commit is contained in:
Rodrigo Rodriguez 2025-01-27 10:55:04 -03:00
parent 8028c821cb
commit 8aff53ef86

View file

@ -531,7 +531,7 @@ export class GBMinService {
try {
// Performs the checking of WhatsApp API if enabled for this instance.
if (min.whatsAppDirectLine != undefined && instance.whatsappServiceKey !== null) {
if (min.whatsAppDirectLine && instance.whatsappServiceKey) {
if (!(await min.whatsAppDirectLine.check(min))) {
const error = `WhatsApp API lost connection for: ${min.botId}.`;
GBLog.error(error);
@ -547,8 +547,8 @@ export class GBMinService {
} catch (error) {
// GB is not OK, 500 and detail the information on response content.
GBLog.error(error);
res.status(500).send(error.toString());
GBLogEx.error(min, error);
res.status(500).send('Service with erros. Please, check service log.');
}
});
}