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 = {}) {
35
35
} catch ( err ) {
36
36
// Remove the input from the error message to avoid leaking sensitive information
37
37
err . input && ( err . input = '*****REDACTED*****' )
38
+ throw err
38
39
}
39
40
40
41
// 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 () {
330
330
parse ( connectionString )
331
331
} catch ( err : unknown ) {
332
332
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' )
333
334
return
334
335
}
335
336
throw new Error ( 'Expected an error to be thrown' )
You can’t perform that action at this time.
0 commit comments