diff --git a/src/pages/decrypt/index.tsx b/src/pages/decrypt/index.tsx index 6a25cab..7d954dd 100644 --- a/src/pages/decrypt/index.tsx +++ b/src/pages/decrypt/index.tsx @@ -62,7 +62,15 @@ export const DecryptZip = () => { encryptionKey ).catch((err) => { console.log('err in decryption:>> ', err) - toast.error(err.message || 'An error occurred while decrypting file.') + + if (err.message.toLowerCase().includes('expected')) { + toast.error(`The Key seems to be invalid length or format`) + } else if (err.message.includes('The JWK "alg" member was inconsistent')) { + toast.error(`The Key seems to be invalid.`) + } else { + toast.error(err.message || 'An error occurred while decrypting file.') + } + setIsLoading(false) return null })