got icon indicating copy to clipboard operation
got copied to clipboard

Not seeing GotError.HTTPError returned on non 2xx/3xx responses

Open 9larsons opened this issue 2 years ago • 1 comments

Got v11.8.6 (also true of v11.0.0)

If I make a call to a site that returns a 404 code (either using nock or an actual site returning 404), I get a HTTPError with very limited information. The docs mention getting a HTTPError with a code of ERR_NON_2XX_3XX_RESPONSE, and that's accurate, but I'm not getting any rich metadata to help with debugging like I used to with Got v9.6.0 (I've been working on upgrading). v9.6.0 threw a GotError.HTTPError which had great data.

Shouldn't there be more data? The old GotError had the response information, gotOptions, statusCode, and statusMessage, all of which were great.

  • [x] I have read the documentation.

9larsons avatar Feb 10 '23 21:02 9larsons

Got v11 is no longer maintained except for critical security bug fixes.

sindresorhus avatar Feb 11 '23 05:02 sindresorhus