diff --git a/src/services/typeDetectionService.ts b/src/services/typeDetectionService.ts index 7208e8cae..184574dd8 100644 --- a/src/services/typeDetectionService.ts +++ b/src/services/typeDetectionService.ts @@ -60,7 +60,11 @@ export async function getFileType( fileFormat, }); } - throw Error(CustomError.INVALID_FILE_TYPE(fileFormat)); + return { + fileType: FILE_TYPE.OTHERS, + exactType: fileFormat, + mimeType: receivedFile instanceof File ? receivedFile.type : null, + }; } } diff --git a/src/utils/error/index.ts b/src/utils/error/index.ts index ce5f9306e..0a2047222 100644 --- a/src/utils/error/index.ts +++ b/src/utils/error/index.ts @@ -49,7 +49,6 @@ export const CustomError = { HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED: 'hidden collection sync file attempted', UNKNOWN_ERROR: 'Something went wrong, please try again', - INVALID_FILE_TYPE: (type: string) => `invalid file type- ${type}`, }; function parseUploadErrorCodes(error) {