new(whatsapp.gblib): New WhatsApp provider: Meta.

This commit is contained in:
Rodrigo Rodriguez 2024-04-30 20:12:11 -03:00
parent 6059c60c06
commit 5f54859790
2 changed files with 8 additions and 12 deletions

View file

@ -610,11 +610,9 @@ export class WhatsappDirectLine extends GBService {
}); });
watermark = response.obj.watermark; watermark = response.obj.watermark;
await this.printMessages(response.obj.activities, conversationId, from, fromName); await this.printMessages(response.obj.activities, conversationId, from, fromName);
} catch (err) { } catch (error) {
GBLog.error( GBLog.error(
`Error calling printMessages on Whatsapp channel ${err.data === undefined ? `Error calling printMessages on Whatsapp channel ${JSON.stringify(error)}`
err : err.data} ${err.errObj ? err.errObj.message : ''
}`
); );
} }
}; };

View file

@ -111,15 +111,13 @@ export class GBServer {
}); });
process.on('uncaughtException', (err, p) => { process.on('uncaughtException', (err, p) => {
if (err !== null) { GBLog.error(`UNCAUGHT_EXCEPTION: ${JSON.stringify(err).}`);
err = err['e'] ? err['e'] : err;
const msg = `${err['code'] ? err['code'] : ''} ${err?.['response']?.['data'] ? err?.['response']?.['data'] : ''} ${err.message ? err.message : ''} ${err['description'] ? err['description'] : ''}`
GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''} ${msg}`);
} else {
GBLog.error('UNCAUGHT_EXCEPTION: Unknown error (err is null)');
}
}); });
// Creates working directory.
process.on('unhandledRejection', (err, p) => {
GBLog.error(`UNHANDLED_REJECTION: ${JSON.stringify(err).}`);
});
// Creates working directory.
process.env.PWD = process.cwd(); process.env.PWD = process.cwd();
const workDir = Path.join(process.env.PWD, 'work'); const workDir = Path.join(process.env.PWD, 'work');