Skip to content

Commit

Permalink
fix(whatsapp.gblib): Fixed check status.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jan 27, 2025
1 parent 8028c82 commit 8aff53e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.');
}
});
}
Expand Down

0 comments on commit 8aff53e

Please sign in to comment.