Skip to content

Commit 392d88c

Browse files
committed
fix(switchDatabase): no error was thrown on scope switch
switchDatabase error was unhandled, which resulted in an unhandled scope switch error. Fixes #470 Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
1 parent 486cb78 commit 392d88c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

connect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ exports.connect = function (config, PassedClass, callback) {
3939
} catch (e) {}
4040

4141
if (switched) {
42-
db.switchDatabase(newConf, function () {
42+
db.switchDatabase(newConf, function (err) {
43+
if (err) {
44+
return callback(err);
45+
}
4346
internals.locTitle = internals.migrationMode;
4447
callback(
4548
null,

0 commit comments

Comments
 (0)