• Exports sync error logs to a JSON file.

    Parameters

    • report: SyncReport

      The sync report containing errors to export.

    Returns void

    If there are no errors, a warning is logged and no file is exported.

    exportSyncErrorLog(report);
    
    export function exportSyncErrorLog(report: SyncReport): void {
    if (!report?.errors?.length) {
    console.warn("No errors to export");
    return;
    }
    const errorLog = {
    timestamp: report.timestamp,
    totalEntries: report.totalEntries,
    successfulUpdates: report.successfulUpdates,
    failedUpdates: report.failedUpdates,
    errors: report.errors,
    };
    exportJsonFile(errorLog, "anilist-sync-errors", report.timestamp);
    console.log("Error log exported successfully");
    }