Skip to content

Commit

Permalink
fix(switchDatabase): no error was thrown on scope switch
Browse files Browse the repository at this point in the history
switchDatabase error was unhandled, which resulted in an unhandled
scope switch error.

Fixes #470

Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
  • Loading branch information
wzrdtales committed Feb 3, 2018
1 parent 486cb78 commit 392d88c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ exports.connect = function (config, PassedClass, callback) {
} catch (e) {}

if (switched) {
db.switchDatabase(newConf, function () {
db.switchDatabase(newConf, function (err) {
if (err) {
return callback(err);
}
internals.locTitle = internals.migrationMode;
callback(
null,
Expand Down

0 comments on commit 392d88c

Please sign in to comment.