send unsupported file extension

This commit is contained in:
Abhinav-grd 2021-08-19 12:03:10 +05:30
parent 9076735374
commit e059f16325

View file

@ -42,7 +42,11 @@ export default async function uploader(
try {
fileTypeInfo = await getFileType(worker, rawFile);
if (fileTypeInfo.fileType === FILE_TYPE.OTHERS) {
throw Error(CustomError.UNSUPPORTED_FILE_FORMAT);
throw Error(
`${CustomError.UNSUPPORTED_FILE_FORMAT}-${
fileTypeInfo.exactType ?? rawFile.name.split('.')[-1]
}`
);
}
metadata = await uploadService.getFileMetadata(
worker,