pdfextract API
    Preparing search index...

    Function collectOrThrow

    • Apply an operation's errorMode to a failure: 'throw' (default) rethrows it, wrapping foreign errors as code; 'collect' returns the warning to report instead. Cancellation always throws.

      Parameters

      • error: unknown
      • errorMode: "throw" | "collect" | undefined
      • signal: AbortSignal
      • code: ErrorCode
      • message: string
      • context: { imageId?: string; pageNumber: number }

      Returns { code: string; imageId?: string; message: string; pageNumber: number }