Extends
Constructors
Constructor
new ApiError(status,error,response):ApiError
Parameters
status
number
error
unknown
response
Response
Returns
ApiError
Overrides
HoneyHiveError.constructor
error
readonlyerror:unknown
response
The Response object from the fetch call. Callreadonlyresponse:Response
await err.response.text() to see details of the error.
status
The HTTP status code of the responsereadonlystatus:number
parseError()
parseError():Returns the parsed error response body with its known type, orErrorResponse|undefined
undefined
if the body doesn’t match the expected shape.
The server’s errorResponseHandler middleware always returns { statusCode, message, success, errorCode } as JSON for all error responses. However,
non-application errors (e.g. a load balancer HTML 502, or Express’s default
404) can bypass that middleware and pass us an unknown shape, in which case
we return undefined.
Returns
ErrorResponse | undefined

