Function handleErrors

  • Handles 5xx and 4xx errors (not 429's) conventionally. 429's should be handled before calling this function

    Parameters

    • manager: RequestManager

      The manager that holds options and emits informational events

    • res: ResponseLike

      The response received from makeNetworkRequest

    • method: string

      The method used to make the request

    • url: string

      The fully resolved url to make the request to

    • requestData: HandlerRequestData

      Extra data from the user's request needed for errors and additional processing

    • retries: number

      The number of retries this request has already attempted (recursion occurs on the handler)

    Returns Promise<ResponseLike>

    The response if the status code is not handled or null to request a retry

Generated using TypeDoc