GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: using console.error for error cases in crypto and events · nodejs/node@6e35803

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • crypto.md
    • events.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/crypto.md‎

Copy file name to clipboardExpand all lines: doc/api/crypto.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let crypto;
4949
try {
5050
crypto = require('node:crypto');
5151
} catch (err) {
52-
console.log('crypto support is disabled!');
52+
console.error('crypto support is disabled!');
5353
}
5454
```
5555

@@ -67,7 +67,7 @@ let crypto;
6767
try {
6868
crypto = await import('node:crypto');
6969
} catch (err) {
70-
console.log('crypto support is disabled!');
70+
console.error('crypto support is disabled!');
7171
}
7272
```
7373

Collapse file

‎doc/api/events.md‎

Copy file name to clipboardExpand all lines: doc/api/events.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ process.nextTick(() => {
10421042
try {
10431043
await once(ee, 'myevent');
10441044
} catch (err) {
1045-
console.log('error happened', err);
1045+
console.error('error happened', err);
10461046
}
10471047
```
10481048

@@ -1067,7 +1067,7 @@ async function run() {
10671067
try {
10681068
await once(ee, 'myevent');
10691069
} catch (err) {
1070-
console.log('error happened', err);
1070+
console.error('error happened', err);
10711071
}
10721072
}
10731073

@@ -1086,7 +1086,7 @@ const ee = new EventEmitter();
10861086

10871087
once(ee, 'error')
10881088
.then(([err]) => console.log('ok', err.message))
1089-
.catch((err) => console.log('error', err.message));
1089+
.catch((err) => console.error('error', err.message));
10901090

10911091
ee.emit('error', new Error('boom'));
10921092

@@ -1100,7 +1100,7 @@ const ee = new EventEmitter();
11001100

11011101
once(ee, 'error')
11021102
.then(([err]) => console.log('ok', err.message))
1103-
.catch((err) => console.log('error', err.message));
1103+
.catch((err) => console.error('error', err.message));
11041104

11051105
ee.emit('error', new Error('boom'));
11061106

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.