From fb878222dd52c2693f59799854d0ac30f1ae921b Mon Sep 17 00:00:00 2001 From: Aster Fialla Date: Tue, 24 Feb 2026 19:49:59 -0500 Subject: [PATCH] removed unnecessary try/catch from utils --- src/helpers/utils.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/helpers/utils.js b/src/helpers/utils.js index 10da0b9..b9d4f44 100644 --- a/src/helpers/utils.js +++ b/src/helpers/utils.js @@ -28,15 +28,10 @@ u.checkImageFormatValidity = async function (imageUrl) { throw new Error(`${enums.err.PROPIC_CANNOT_LOAD}: ${e.message}`); } - try { - blobFile = await response.blob(); - if (blobFile.size > 10000000 || !acceptableImages.includes(blobFile.type)) throw new Error(enums.err.PROPIC_FAILS_REQUIREMENTS); + blobFile = await response.blob(); + if (blobFile.size > 10000000 || !acceptableImages.includes(blobFile.type)) throw new Error(enums.err.PROPIC_FAILS_REQUIREMENTS); - return true; - } - catch(error) { - throw new Error(error.message); - } + return true; } export const utils = u;