Skip to content

Commit f09c23d

Browse files
authored
Merge pull request #1592 from bombjackit/patch-acquire
_acquire in case of reject return a promise, if this._acquire.promise is used in acquire, in case of reject an exception is raised that is not "captured" by the catch
2 parents 1d8a2f4 + 55f5a9f commit f09c23d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/base/connection-pool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class ConnectionPool extends EventEmitter {
363363
*/
364364

365365
acquire (requester, callback) {
366-
const acquirePromise = shared.Promise.resolve(this._acquire().promise).catch(err => {
366+
const acquirePromise = shared.Promise.resolve(this._acquire()).catch(err => {
367367
this.emit('error', err)
368368
throw err
369369
})
@@ -382,7 +382,7 @@ class ConnectionPool extends EventEmitter {
382382
return shared.Promise.reject(new ConnectionError('Connection is closing', 'ENOTOPEN'))
383383
}
384384

385-
return this.pool.acquire()
385+
return this.pool.acquire().promise
386386
}
387387

388388
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy