From 3b323027be86aa13bdd497aac7b12a8c60b2b65c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 30 Apr 2010 10:28:18 -0700 Subject: [PATCH] http server emits 'clientError' --- doc/api.markdown | 7 +++++++ lib/http.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/api.markdown b/doc/api.markdown index 6a99a17..5bafa8a 100644 --- a/doc/api.markdown +++ b/doc/api.markdown @@ -1594,6 +1594,13 @@ options argument for `net.Server`. The `request_listener` is a function which is automatically added to the `'request'` event. + +### Event: 'clientError' + +`function (exception) {}` + +If a client connection emits an 'error' event - it will forwarded here. + ### server.listen(port, hostname) diff --git a/lib/http.js b/lib/http.js index 884fd9a..b7adee5 100644 --- a/lib/http.js +++ b/lib/http.js @@ -552,7 +552,7 @@ function connectionListener (socket) { } socket.addListener('error', function (e) { - sys.puts('node http server: ' + e); + self.emit('clientError', e); }); socket.ondata = function (d, start, end) { -- 2.7.4