When i try to restart mongodb service from services.msc, nodejs server is crashing with this error:
OR

My code looks like this
_client = await MongoClient.connect(this._config.connectionString, {
useNewUrlParser: true,
useUnifiedTopology: true,
reconnectTries: 60,
reconnectInterval: 1000,
keepAlive: true,
autoReconnect: true,
});
What ever i do, im not able to catch this exception there fore my node server is crashing. Is there a way to catch this reliably? To answer a question, why i'm trying this scenario: Sometimes our deployed server is losing connection(to mongoDB) in the cloud and ending up crashing and kick starting new pod in aks.
I'm using mongodb driver, not mongoose.