Skip to content

Commit 25ac669

Browse files
jasnellMylesBorins
authored andcommitted
doc: add comment to example about 2xx status codes
Fixes: #29714 PR-URL: #34223 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 6f014d0 commit 25ac669

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/http.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,6 +2233,8 @@ http.get('http://nodejs.org/dist/index.json', (res) => {
22332233
const contentType = res.headers['content-type'];
22342234

22352235
let error;
2236+
// Any 2xx status code signals a successful response but
2237+
// here we're only checking for 200.
22362238
if (statusCode !== 200) {
22372239
error = new Error('Request Failed.\n' +
22382240
`Status Code: ${statusCode}`);

0 commit comments

Comments
 (0)