From c1923e1494f7770209890874cf47d52197f6cd42 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Wed, 24 Jun 2015 13:38:41 +0300 Subject: [PATCH] Add error event in documentation Closes #74 --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 92a0cc2..bfb48ab 100644 --- a/readme.md +++ b/readme.md @@ -130,6 +130,9 @@ When in stream mode, you can listen for events: `redirect` event to get the response object of redirect. Second argument is options for next request to the redirect location. +##### .on('error', error, body, response) + +`error` event emitted in case of protocol error (like ENOTFOUND etc.) or status error (4xx or 5xx). Second argument is body of server response in case of status error. Third argument is response object. ###### response