diff --git a/utils/ffmpeg/index.ts b/utils/ffmpeg/index.ts index ae5ddff4b3..8ea5f40f5e 100644 --- a/utils/ffmpeg/index.ts +++ b/utils/ffmpeg/index.ts @@ -43,17 +43,13 @@ export const transcode = async ( const baseName = basename(fileName); const newName = `${basename(fileName, extname(fileName))}.${extension}`; - try { - ffmpeg.FS("writeFile", baseName, fileData); - await ffmpeg.run("-i", baseName, newName); - - returnFiles.push([ - join(dirname(fileName), newName), - Buffer.from(ffmpeg.FS("readFile", newName) as Uint8Array), - ]); - } catch { - // Ignore failure while reading/writing files - } + ffmpeg.FS("writeFile", baseName, fileData); + await ffmpeg.run("-i", baseName, newName); + + returnFiles.push([ + join(dirname(fileName), newName), + Buffer.from(ffmpeg.FS("readFile", newName) as Uint8Array), + ]); }) ); diff --git a/utils/sheetjs.ts b/utils/sheetjs.ts index d4fbcaeadd..026d6e2220 100644 --- a/utils/sheetjs.ts +++ b/utils/sheetjs.ts @@ -31,18 +31,9 @@ export const convertSheet = async ( numbers = window.XLSX_ZAHL_PAYLOAD; } - // eslint-disable-next-line no-undef-init - let sheet: Uint8Array | undefined = undefined; - - try { - sheet = sheetJs.write(sheetJs.read(fileData), { - bookType: extension as XLSX.BookType, - numbers, - type: "buffer", - }) as Uint8Array; - } catch { - // Ignore failure to read/write sheet - } - - return sheet || Buffer.from(""); + return sheetJs.write(sheetJs.read(fileData), { + bookType: extension as XLSX.BookType, + numbers, + type: "buffer", + }) as Uint8Array; };