Skip to content

Commit 7ad4468

Browse files
authored
Add error handling for non-function callback
catch callback not a function earlier to get a proper callstack. later when executing the callback the stack may be wrong/insufficient.
1 parent 8d493f3 commit 7ad4468

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/pg/lib/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ class Client extends EventEmitter {
588588
Error.captureStackTrace(err)
589589
throw err
590590
})
591+
} else {
592+
if(!(typeof values === 'function')){
593+
throw new Error('callback is not a function')
594+
}
591595
}
592596
}
593597

0 commit comments

Comments
 (0)