File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -543,16 +543,12 @@ class Client extends EventEmitter {
543543 query . _result . _types = this . _types
544544 }
545545
546- if ( ! this . _queryable ) {
546+ if ( ! this . _queryable || this . _ending ) {
547547 process . nextTick ( ( ) => {
548- query . handleError ( new Error ( 'Client has encountered a connection error and is not queryable' ) , this . connection )
549- } )
550- return result
551- }
552-
553- if ( this . _ending ) {
554- process . nextTick ( ( ) => {
555- query . handleError ( new Error ( 'Client was closed and is not queryable' ) , this . connection )
548+ let err
549+ if ( this . _ending ) err = new Error ( 'Client was closed and is not queryable' )
550+ else err = new Error ( 'Client has encountered a connection error and is not queryable' )
551+ query . handleError ( err , this . connection )
556552 } )
557553 return result
558554 }
You can’t perform that action at this time.
0 commit comments