Skip to content

Commit

Permalink
Merge pull request #1 from godaddy/avoid-pool-mutation
Browse files Browse the repository at this point in the history
Removing direct reference to pool dsn and connection properties from …
  • Loading branch information
gshively11 authored Aug 14, 2017
2 parents 9e204be + 203c133 commit 56caadc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pool-error.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export default class PoolError extends Error {
constructor(pool, err) {
super(err);
this.pool = { ...pool };
// don't want passwords appearing in errors
delete this.pool.dsn.password;
// clone the dsn and don't expose the password
if (pool && pool.dsn) {
this.dsn = { ...pool.dsn };
delete this.dsn.password;
}
}
}

0 comments on commit 56caadc

Please sign in to comment.