Skip to content

Commit 16512f6

Browse files
committed
fix(log): error ended up in unreadable errors
Fixes #524 Fixes #521
1 parent a1bf9e8 commit 16512f6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

lib/commands/on-complete.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ module.exports = function (migrator, internals, callback, originalErr) {
88

99
migrator.driver.close(function (err) {
1010
if ((err || originalErr) && typeof callback === 'function') {
11-
callback(
12-
new Error({
13-
err: err,
14-
originalErr: originalErr
15-
})
16-
);
11+
callback(originalErr || err);
1712
return;
1813
} else {
1914
assert.ifError(originalErr);

lib/driver/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,14 @@ exports.connect = function (config, intern, callback) {
7474
driver = require(req);
7575
} catch (e4) {
7676
return callback(
77-
new Error({
78-
stack:
79-
'No such driver found, please try to install it via ' +
77+
new Error(
78+
'No such driver found, please try to install it via ' +
8079
'npm install db-migrate-' +
8180
config.driver +
8281
' or ' +
8382
'npm install -g db-migrate-' +
8483
config.driver
85-
})
84+
)
8685
);
8786
}
8887
}

0 commit comments

Comments
 (0)