File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed
packages/pg-connection-string Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ function parse(str, options = {}) {
3535 } catch ( err ) {
3636 // Remove the input from the error message to avoid leaking sensitive information
3737 err . input && ( err . input = '*****REDACTED*****' )
38+ throw err
3839 }
3940
4041 // We'd like to use Object.fromEntries() here but Node.js 10 does not support it
Original file line number Diff line number Diff line change @@ -330,6 +330,7 @@ describe('parse', function () {
330330 parse ( connectionString )
331331 } catch ( err : unknown ) {
332332 expect ( JSON . stringify ( err ) ) . to . not . include ( password , 'Password should not be in the error message' )
333+ expect ( JSON . stringify ( err ) ) . to . include ( 'REDACTED' , 'The thrown error should contain the redacted URL' )
333334 return
334335 }
335336 throw new Error ( 'Expected an error to be thrown' )
You can’t perform that action at this time.
0 commit comments