The sync report containing errors to export.
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");
}
Exports sync error logs to a JSON file.