Skip to content

Commit cf0cb17

Browse files
committed
Log additional error properties
1 parent ff8c3a4 commit cf0cb17

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/commands/helper/register-events.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ var log = require('db-migrate-shared').log;
55
function registerEvents () {
66
process.on('uncaughtException', function (err) {
77
log.error('uncaughtException');
8-
log.error(err.stack || err);
8+
log.error(err);
99
process.exit(1);
1010
});
1111

1212
process.on('unhandledRejection', function (reason) {
1313
log.error('unhandledRejection');
14-
log.error(reason.stack || reason);
14+
log.error(reason);
1515
process.exit(1);
1616
});
1717
}

lib/commands/on-complete.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = function (migrator, internals, originalErr, results) {
1010
callback(originalErr || err);
1111
return;
1212
} else {
13+
if (originalErr instanceof Error) throw originalErr;
1314
assert.ifError(originalErr);
1415
assert.ifError(err);
1516
log.info('Done');

0 commit comments

Comments
 (0)