Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit e76c8b3

Browse files
committed
Better assignee and error handling
1 parent 6601dc6 commit e76c8b3

File tree

4 files changed

+1333
-23
lines changed

4 files changed

+1333
-23
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
'use strict';
55

66
const kafka = require('./utils/kafka');
7+
const logger = require('./utils/logger');
8+
9+
process.on('uncaughtException', (err) => {
10+
// Check if error related to Dynamodb conn
11+
if (err.code === 'NetworkingError' && err.region) {
12+
logger.error('DynamoDB connection failed.');
13+
}
14+
logger.logFullError(err, 'system');
15+
});
16+
17+
// handle and log unhanled rejection
18+
process.on('unhandledRejection', (err) => {
19+
logger.logFullError(err, 'system');
20+
});
721

822
// run the server
923
kafka.run();

0 commit comments

Comments
 (0)