Skip to content

Commit 7d850d2

Browse files
Uzlopakwolfy1339
andauthored
chore: improve comments (#445)
Co-authored-by: wolfy1339 <[email protected]>
1 parent e24d923 commit 7d850d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export class RequestError extends Error {
3737

3838
this.name = "HttpError";
3939

40-
// Implicit coercion to number if statusCode is a string
40+
// Coerce the statusCode to an integer especially if it is a string
4141
this.status = Number.parseInt(statusCode as unknown as string);
4242

43-
// If status is not equal to itself, then it is NaN
44-
// we set then the status to 0
43+
// If status code is NaN, then set status to 0 to signal e.g. a network
44+
// error or a AbortError
4545
if (Number.isNaN(this.status)) {
4646
this.status = 0;
4747
}

0 commit comments

Comments
 (0)