improve error logging

This commit is contained in:
Abhinav 2023-03-02 13:23:19 +05:30
parent 84a2a00c61
commit 60fcf46c63

View file

@ -241,6 +241,7 @@ class ExportService {
RecordType.SUCCESS
);
} catch (e) {
logError(e, 'export failed for a file');
if (
e.message ===
CustomError.ADD_FILE_EXPORTED_RECORD_FAILED
@ -252,11 +253,6 @@ class ExportService {
file,
RecordType.FAILED
);
logError(
e,
'download and save failed for file during export'
);
}
this.electronAPIs.showOnTray({
export_progress: `${index + 1} / ${
@ -446,6 +442,7 @@ class ExportService {
}
async downloadAndSave(file: EnteFile, collectionPath: string) {
try {
file.metadata = mergeMetadata([file])[0].metadata;
const fileSaveName = getUniqueFileSaveName(
collectionPath,
@ -474,9 +471,17 @@ class ExportService {
if (file.metadata.fileType === FILE_TYPE.LIVE_PHOTO) {
await this.exportMotionPhoto(fileStream, file, collectionPath);
} else {
await this.saveMediaFile(collectionPath, fileSaveName, fileStream);
await this.saveMediaFile(
collectionPath,
fileSaveName,
fileStream
);
await this.saveMetadataFile(collectionPath, fileSaveName, file);
}
} catch (e) {
logError(e, 'download and save failed');
throw e;
}
}
private async exportMotionPhoto(