switch from throw to send err to callback

This commit is contained in:
David Dias 2016-04-25 02:13:49 +01:00
parent ce6edb05a2
commit c253a44f59

View File

@ -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) => {