Function isTransientError

  • Checks if an error is transient and should be retried.

    Parameters

    • error: unknown

      The error to check

    Returns boolean

    true if the error is transient

    try {
    await db.run('INSERT INTO users (name) VALUES (?)', ['Alice']);
    } catch (error) {
    if (isTransientError(error)) {
    // Retry the operation
    }
    }