ChemPal Documentation - v1.17.0
    Preparing search index...

    Function isAbortError

    • True for an AbortError, the error a cancelled fetch rejects with. A user stop or a search-budget timeout is expected and must not be treated as a supplier failure.

      Parameters

      • error: unknown

        Whatever was thrown or rejected with

      Returns boolean

      true when the value is an Error named AbortError

      isAbortError(new DOMException('stop', 'AbortError')); // true
      isAbortError('user_aborted'); // false (see isExpectedAbort)
      export function isAbortError(error: unknown): boolean {
      return error instanceof Error && error.name === 'AbortError';
      }