how can i set a callback for the error handling if mongoose isn\'t able to connect to my DB?
i know of
connection.on(\'open\', function () { ... });
mongoose.connect(
"mongodb://..."
).catch((e) => {
console.log("error connecting to mongoose!");
});
mongoose.connection.on("error", (e) => {
console.log("mongo connect error!");
});
mongoose.connection.on("connected", () => {
console.log("connected to mongo");
});