From ad487d3226928b7e3783c0d3b703e97a72cb5727 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 5 May 2011 15:40:45 -0700 Subject: [PATCH] Add on('error') to http request example for indexzero --- doc/api/http.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 6cecc821cf..e16d384b7a 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -396,6 +396,10 @@ Example: }); }); + req.on('error', function(e) { + console.log('problem with request: ' + e.message); + }); + // write data to request body req.write('data\n'); req.write('data\n');