Error thrown when an HTTP response has a non-2xx status. Carries the numeric
status so callers can branch on it (e.g. retrying a 403 WAF cookie
challenge) rather than string-matching the message.
Param: status
The HTTP status code (e.g. 403)
Param: statusText
The HTTP status text (e.g. "Forbidden")
Returns
The HttpError instance
Example
try { awaitfetchDecorator(url); } catch (error) { if (error instanceofHttpError&& error.status ===403) { // retry the request } }
Error thrown when an HTTP response has a non-2xx status. Carries the numeric status so callers can branch on it (e.g. retrying a
403WAF cookie challenge) rather than string-matching the message.Param: status
The HTTP status code (e.g. 403)
Param: statusText
The HTTP status text (e.g. "Forbidden")
Returns
The HttpError instance
Example
Source