Skip to content

Commit a0bcbcb

Browse files
committed
Log connection errors
1 parent aaac334 commit a0bcbcb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

web.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true }).catch(
190190
console.log(err);
191191
});
192192

193+
mongoose.connection.on('error', err => {
194+
logError(err);
195+
});
196+
193197
// Middleware config
194198
app.use(allowCrossDomain);
195199
app.use(express.urlencoded({

0 commit comments

Comments
 (0)