Sanity Library Reference Docs
    Preparing search index...

    Class UnrecoverableErrorBeta

    Error type indicating an unrecoverable error in a durable function. Used to abort any remaining retry behavior in a durable step operation. Durable functions are an experimental feature and may change in the future.

    const handler = durableEventHandler(async ({step}) => {
    const user = await step.run({name: 'get-user', handler: async ({attempt}) => {
    try {
    return await getUser('some-user')
    } catch (err) {
    if (err instanceof UserNotFound) {
    throw new UnrecoverableError(err)
    }
    throw err
    }
    }, retry: {maxAttempts: 3})
    })

    Hierarchy

    • Error
      • UnrecoverableError
    Index

    Constructors

    Properties

    Constructors

    • Beta

      Parameters

      • Optionalmessage: string

      Returns UnrecoverableError

    • Beta

      Parameters

      • Optionalmessage: string
      • Optionaloptions: ErrorOptions

      Returns UnrecoverableError

    Properties

    name: string = 'UnrecoverableError'