From e2b458080913e5290ecafd78e83f647662f8c205 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Mon, 17 Aug 2015 18:30:53 +0500 Subject: [PATCH] improve promise usage example --- readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 36cdc00..c2345bc 100644 --- a/readme.md +++ b/readme.md @@ -40,7 +40,10 @@ got('todomvc.com') .then(function (res) { console.log(res.body); }) - .catch(console.error); + .catch(function (err) { + console.error(err); + console.error(err.response && err.response.body); + }); // Stream mode got.stream('todomvc.com').pipe(fs.createWriteStream('index.html'));