Skip to content

Commit ce21d01

Browse files
committed
remove "semi-functional" socket cleanup stuff
1 parent 5410fb2 commit ce21d01

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Server.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,10 @@ function onRequest( request, response ){
124124
}
125125

126126
function onError( e ){
127-
debug('Failed to start http server', e);
127+
if (e.code === 'EADDRINUSE')
128+
throw new Error((isSocket(this.endpoint) ? 'Socket' : 'Port') + ' in use');
128129

129-
if (e.code === 'EADDRINUSE' && isSocket(this.endpoint)) {
130-
debug('Socket path existed');
131-
fs.unlinkSync(this.endpoint);
132-
this.listen(this.endpoint);
133-
}
130+
throw e;
134131
}
135132

136133
function endRequest(){

0 commit comments

Comments
 (0)