Skip to content

Commit

Permalink
fix: non-pg error not handled properly (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Sep 24, 2016
1 parent 5c729f8 commit a4a7594
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion createdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ createdb({

function die (err, argv) {
if (err) {
if (!argv.silent) console.log(err.pgErr.toString());
if (!argv.silent) console.log(err.pgErr ? err.pgErr.toString() : err.toString());
process.exit(-1);
}
}
2 changes: 1 addition & 1 deletion dropdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dropdb({

function die (err, argv) {
if (err) {
if (!argv.silent) console.log(err.pgErr.toString());
if (!argv.silent) console.log(err.pgErr ? err.pgErr.toString() : err.toString());
process.exit(-1);
}
}

0 comments on commit a4a7594

Please sign in to comment.