Skip to content

classifyHttp

function classifyHttp(status, body): ErrorKind;

Defined in: core/src/errors.ts:571

The kind of a failure that arrived as an HTTP response: a status and a body, with nothing thrown.

classify below is for a caught error, and it reads status and the body text off that error when they are not passed separately. A response has no error object, so callers were inventing one to fill the slot: a bare body string, the same text twice, a { status, error } literal. All three are inert (nothing on them can satisfy isAbort or isTransportFailure), so they were three spellings of undefined.

Parameter Type
status number | undefined
body string

ErrorKind