Every line of 'mongonetworkerror' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
28 mongoose.connection.on("error", function mongoConnectionError(err) { 29 if (err.message.code === "ETIMEDOUT") { 30 logger.warn("Mongo connection timeout!", err); 31 setTimeout(() => { 32 mongoose.createConnection(config.db.uri, config.db.options); 33 }, 1000); 34 return; 35 } 36 37 logger.error("Could not connect to MongoDB!"); 38 return logger.error(err); 39 });
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code