test: process exit when errors

This commit is contained in:
Davidson Gomes 2023-09-04 13:00:16 -03:00
parent af2a652098
commit f83d8de476
2 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,7 @@
"@figuro/chatwoot-sdk": "^1.1.14", "@figuro/chatwoot-sdk": "^1.1.14",
"@hapi/boom": "^10.0.1", "@hapi/boom": "^10.0.1",
"@sentry/node": "^7.59.2", "@sentry/node": "^7.59.2",
"@whiskeysockets/baileys": "github:EvolutionAPI/Baileys", "@whiskeysockets/baileys": "^6.4.1",
"amqplib": "^0.10.3", "amqplib": "^0.10.3",
"axios": "^1.3.5", "axios": "^1.3.5",
"class-validator": "^0.13.2", "class-validator": "^0.13.2",

View File

@ -83,6 +83,11 @@ function bootstrap() {
httpService.post('', errorData); httpService.post('', errorData);
} }
if (err['message'].includes('No sessions') || err['message'].includes('Connection Closed')) {
console.log(err['message']);
process.exit(1);
}
return res.status(err['status'] || 500).json({ return res.status(err['status'] || 500).json({
status: err['status'] || 500, status: err['status'] || 500,
error: err['error'] || 'Internal Server Error', error: err['error'] || 'Internal Server Error',