Skip to content

Commit

Permalink
Log additional error properties
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed Apr 24, 2023
1 parent ff8c3a4 commit cf0cb17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/commands/helper/register-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ var log = require('db-migrate-shared').log;
function registerEvents () {
process.on('uncaughtException', function (err) {
log.error('uncaughtException');
log.error(err.stack || err);
log.error(err);
process.exit(1);
});

process.on('unhandledRejection', function (reason) {
log.error('unhandledRejection');
log.error(reason.stack || reason);
log.error(reason);
process.exit(1);
});
}
Expand Down
1 change: 1 addition & 0 deletions lib/commands/on-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (migrator, internals, originalErr, results) {
callback(originalErr || err);
return;
} else {
if (originalErr instanceof Error) throw originalErr;
assert.ifError(originalErr);
assert.ifError(err);
log.info('Done');
Expand Down

0 comments on commit cf0cb17

Please sign in to comment.