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

Commit d6b17f8

Browse files
committed
Fixed for dynamoDB connection handling
1 parent 1cec9d9 commit d6b17f8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,17 @@ app.use((err, req, res, next) => { // eslint-disable-line no-unused-vars
5959
});
6060
});
6161

62+
process.on('uncaughtException', (err) => {
63+
// Check if error related to Dynamodb conn
64+
if (err.code === 'NetworkingError' && err.region) {
65+
logger.error('DynamoDB connection failed.');
66+
}
67+
logger.logFullError(err, 'system');
68+
});
69+
70+
// handle and log unhanled rejection
71+
process.on('unhandledRejection', (err) => {
72+
logger.logFullError(err, 'system');
73+
});
74+
6275
module.exports = app;

0 commit comments

Comments
 (0)