Error class to be thrown when the API response is a non-success status.

Hierarchy

  • Error
    • HttpResponseError

Constructors

  • Create a new HttpResponseError to be thrown

    Parameters

    • request: Request

      Request object used to make the API request via fetch

    • response: Response

      Response object returned from the API

    • Optional message: string

      (optional) Error message, will default to the statusText of the response

    Returns HttpResponseError

Properties

cause?: unknown
message: string
name: string
request: Request

Request object used to make the API request via fetch

response: Response

Response object returned from the API

stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void