diff --git a/src/gif.ts b/src/gif.ts index ea6f115..dea0445 100644 --- a/src/gif.ts +++ b/src/gif.ts @@ -48,7 +48,7 @@ const extractBuff = (gif: Buffer) => { } end = sec.end; } - throw "Shouldn't happen"; + throw new Error("Shouldn't happen"); // metadata ended, nothing... }; diff --git a/src/jpg.ts b/src/jpg.ts index b659150..c2150df 100644 --- a/src/jpg.ts +++ b/src/jpg.ts @@ -49,7 +49,7 @@ export const convertToPng = async (f: File): Promise => { const inject = async (b: File, c: File[]) => { const pngfile = await convertToPng(b); if (!pngfile || pngfile.size > 3000 * 1024) { - throw "Couldn't convert file to PNG: resulting filesize too big."; + throw new Error("Couldn't convert file to PNG: resulting filesize too big."); } return pngv3.inject!(new File([pngfile], b.name), c); };