Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/crypto.md6
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);