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

@@ -83,6 +83,11 @@ function bootstrap() {
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({
status: err['status'] || 500,
error: err['error'] || 'Internal Server Error',