diff options
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/crypto.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 45f31a00384..00bdfbc6fdc 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -5285,8 +5285,7 @@ const receivedPlaintext = decipher.update(ciphertext, null, 'utf8'); try { decipher.final(); } catch (err) { - console.error('Authentication failed!'); - return; + throw new Error('Authentication failed!', { cause: err }); } console.log(receivedPlaintext); @@ -5330,8 +5329,7 @@ const receivedPlaintext = decipher.update(ciphertext, null, 'utf8'); try { decipher.final(); } catch (err) { - console.error('Authentication failed!'); - return; + throw new Error('Authentication failed!', { cause: err }); } console.log(receivedPlaintext); |