file already protected handled

This commit is contained in:
atharva.dev 2025-10-27 20:51:39 +05:30
parent 60b90f2f4d
commit c8ce3b1f94
1 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,11 @@ async function protectFileWithHotFolder(
Logger.debug(who + 'File uploaded successfully', { fileStorageId: uploadResult.fileStorageId, fileName, correlationId });
// check if the file is already protected
if (uploadResult.protected) {
throw new Error('File is already protected');
}
originalFileStorageId = uploadResult.fileStorageId;
// Protect the uploaded file with HotFolder