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 () { ... });
Late answer, but if you want to keep the server running you can use this:
mongoose.connect('mongodb://localhost/dbname',function(err) { if (err) return console.error(err); });