Skip to content

Commit 2d2a873

Browse files
nyurikcharmander
authored andcommitted
Minor cleanup - inline throwOnRelease() (#129)
The throwOnRelease() function does not appear to be exposed anywhere, and it does not appear to make any sense to have it as a standalone func, as it ovecomplicates things and makes function call as non-returning. Inlined it.
1 parent 70d5c09 commit 2d2a873

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ class PendingItem {
2525
}
2626
}
2727

28-
function throwOnRelease () {
29-
throw new Error('Release called on client which has already been released to the pool.')
30-
}
31-
3228
function promisify (Promise, callback) {
3329
if (callback) {
3430
return { callback: callback, result: undefined }
@@ -248,7 +244,7 @@ class Pool extends EventEmitter {
248244

249245
client.release = (err) => {
250246
if (released) {
251-
throwOnRelease()
247+
throw new Error('Release called on client which has already been released to the pool.')
252248
}
253249

254250
released = true

0 commit comments

Comments
 (0)