Class StopRetrying

A custom Error subclass which acts as a “sentinel”: when you return it either as the top-level return value from the callback for withRetries or the rejection reason for a Task produces by withRetries, the function will stop retrying immediately.

You can neither construct this class directly nor subclass it. Instead, use the stopRetrying helper function to construct it.

Hierarchy

  • Error
    • StopRetrying

Constructors

  • Parameters

    • Optionalmessage: string

    Returns StopRetrying

  • Parameters

    • Optionalmessage: string
    • Optionaloptions: ErrorOptions

    Returns StopRetrying

Properties

cause?: unknown
message: string
stack?: string
prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

Optional override for formatting stack traces

stackTraceLimit: number

Accessors

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void