From 3f125f105e3b328942c04ef73579b1573fc39b5a Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Sun, 10 May 2020 23:25:50 +0800 Subject: [PATCH] Clarify docs for got.HTTPError (#1244) * Clarify docs for got.HTTPError * Update readme.md Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> * No special term and don't change ParseError Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 429f46b1a..b1113238e 100644 --- a/readme.md +++ b/readme.md @@ -523,7 +523,7 @@ const got = require('got'); Type: `boolean`\ Default: `true` -Determines if a `got.HTTPError` is thrown for error responses (non-2xx status codes). +Determines if a [`got.HTTPError`](#gothttperror) is thrown for unsuccessful responses. If this is disabled, requests that encounter an error status code will be resolved with the `response` instead of throwing. This may be useful if you are checking for resource availability and are expecting error responses. @@ -1302,7 +1302,7 @@ When server response code is 2xx, and parsing body fails. Includes a `response` #### got.HTTPError -When the server response code is not 2xx. Includes a `response` property. +When the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304. Includes a `response` property. #### got.MaxRedirectsError