Skip to content

Commit

Permalink
fix(log): error ended up in unreadable errors
Browse files Browse the repository at this point in the history
Fixes #524
Fixes #521
  • Loading branch information
wzrdtales committed Dec 1, 2017
1 parent 9fae370 commit 97de65d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 1 addition & 6 deletions lib/commands/on-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ module.exports = function (migrator, internals, callback, originalErr) {

migrator.driver.close(function (err) {
if ((err || originalErr) && typeof callback === 'function') {
callback(
new Error({
err: err,
originalErr: originalErr
})
);
callback(originalErr || err);
return;
} else {
assert.ifError(originalErr);
Expand Down
7 changes: 3 additions & 4 deletions lib/driver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ exports.connect = function (config, intern, callback) {
driver = require(req);
} catch (e4) {
return callback(
new Error({
stack:
'No such driver found, please try to install it via ' +
new Error(
'No such driver found, please try to install it via ' +
'npm install db-migrate-' +
config.driver +
' or ' +
'npm install -g db-migrate-' +
config.driver
})
)
);
}
}
Expand Down

0 comments on commit 97de65d

Please sign in to comment.