From 4d528ba16d5ab59f239d7b8cee8d5c42b56b14ca Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 25 Apr 2016 02:21:32 +0100 Subject: [PATCH] chore: release version v0.4.1 --- package.json | 2 +- src/index.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c1da5a5..b088993 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libp2p-websockets", - "version": "0.4.0", + "version": "0.4.1", "description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec", "main": "lib/index.js", "jsnext:main": "src/index.js", diff --git a/src/index.js b/src/index.js index fa189fd..8b11ad8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ 'use strict' -// const debug = require('debug') -// const log = debug('libp2p:tcp') +const debug = require('debug') +const log = debug('libp2p:websockets') const SWS = require('simple-websocket') const mafmt = require('mafmt') @@ -61,7 +61,8 @@ function WebSockets () { this.close = (callback) => { if (listeners.length === 0) { - callback(new Error('there are no listeners')) + log('Called close with no active listeners') + return callback() } var count = 0 listeners.forEach((listener) => {