Skip to content

Commit 5bef339

Browse files
Dan WahlinDan Wahlin
Dan Wahlin
authored and
Dan Wahlin
committed
Added error handler
1 parent 52e2e2e commit 5bef339

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/database.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ let connection = null;
88
class Database {
99

1010
open(callback) {
11-
mongoose.connect(connectionString);
11+
const options = {};
12+
mongoose.connect(connectionString, options, (err) => {
13+
if (err) {
14+
console.log('mongoose.connect() failed: ' + err);
15+
}
16+
});
1217
connection = mongoose.connection;
1318
mongoose.Promise = global.Promise;
1419

0 commit comments

Comments
 (0)