Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6d399e1

Browse filesBrowse files
tniessenBethGriggs
authored andcommitted
doc: fix CCM cipher example in MJS
The original example used 'return' to terminate the current control flow, which is valid in CommonJS. When the example was copied and modified to use MJS syntax, the 'return' statement was left in but is not allowed. Refs: #37594 PR-URL: #39949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 9f3a015 commit 6d399e1
Copy full SHA for 6d399e1

File tree

Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/crypto.md‎

Copy file name to clipboardExpand all lines: doc/api/crypto.md
+2-4Lines changed: 2 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -5283,8 +5283,7 @@ const receivedPlaintext = decipher.update(ciphertext, null, 'utf8');
52835283
try {
52845284
decipher.final();
52855285
} catch (err) {
5286-
console.error('Authentication failed!');
5287-
return;
5286+
throw new Error('Authentication failed!', { cause: err });
52885287
}
52895288

52905289
console.log(receivedPlaintext);
@@ -5328,8 +5327,7 @@ const receivedPlaintext = decipher.update(ciphertext, null, 'utf8');
53285327
try {
53295328
decipher.final();
53305329
} catch (err) {
5331-
console.error('Authentication failed!');
5332-
return;
5330+
throw new Error('Authentication failed!', { cause: err });
53335331
}
53345332

53355333
console.log(receivedPlaintext);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.