kernl API
    Preparing search index...

    Function isCorruptionError

    • Whether an error means the database file is damaged, rather than busy, full or misused.

      Parameters

      • error: unknown

        Whatever a sqlite call threw.

      Returns boolean

      True for SQLITE_CORRUPT, SQLITE_NOTADB and their messages.

      import { isCorruptionError } from '@kernlize/core/cache';

      isCorruptionError(new Error('SQLITE_CORRUPT: database disk image is malformed')); // true
      isCorruptionError(new Error('SQLITE_BUSY: database is locked')); // false