diff --git a/src/index.js b/src/index.js index bb0f709..bd3a1a2 100644 --- a/src/index.js +++ b/src/index.js @@ -63,7 +63,7 @@ function TCP () { this.close = (callback) => { if (listeners.length === 0) { - throw new Error('there are no listeners') + callback(new Error('there are no listeners')) } var count = 0 listeners.forEach((listener) => {