add export directory exists checks
This commit is contained in:
parent
60fcf46c63
commit
eabcc72b61
|
@ -375,6 +375,13 @@ class ExportService {
|
|||
if (!folder) {
|
||||
folder = getData(LS_KEYS.EXPORT)?.folder;
|
||||
}
|
||||
if (!folder) {
|
||||
throw Error(CustomError.NO_EXPORT_FOLDER_SELECTED);
|
||||
}
|
||||
const exportFolderExists = this.exists(folder);
|
||||
if (!exportFolderExists) {
|
||||
throw Error(CustomError.EXPORT_FOLDER_DOES_NOT_EXIST);
|
||||
}
|
||||
const recordFile = await this.electronAPIs.getExportRecord(
|
||||
`${folder}/${EXPORT_RECORD_FILE_NAME}`
|
||||
);
|
||||
|
|
|
@ -56,6 +56,8 @@ export const CustomError = {
|
|||
NETWORK_ERROR: 'Network Error',
|
||||
NOT_FILE_OWNER: 'not file owner',
|
||||
ADD_FILE_EXPORTED_RECORD_FAILED: 'add file exported record failed',
|
||||
NO_EXPORT_FOLDER_SELECTED: 'no export folder selected',
|
||||
EXPORT_FOLDER_DOES_NOT_EXIST: 'export folder does not exist',
|
||||
};
|
||||
|
||||
export function parseUploadErrorCodes(error) {
|
||||
|
|
Loading…
Reference in a new issue