summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremirgoren <61096652+emirgoren@users.noreply.github.com>2022-12-07 03:47:15 +0300
committerDanielle Adams <adamzdanielle@gmail.com>2023-01-04 20:31:52 -0500
commit5c69965972fd9f21a0df84ad4eab4b0f81cc1ca9 (patch)
tree9ce63f72006d4d86e0b4c0b385d7699b66b49471
parent5ac8515508f451ef3d7612363d6b0e79a47e2479 (diff)
downloadnode-new-5c69965972fd9f21a0df84ad4eab4b0f81cc1ca9.tar.gz
doc: using console.error for error cases in crypto and events
PR-URL: https://github.com/nodejs/node/pull/45640 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r--doc/api/crypto.md4
-rw-r--r--doc/api/events.md8
2 files changed, 6 insertions, 6 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
index 5191727c74..1ec38a87c6 100644
--- a/doc/api/crypto.md
+++ b/doc/api/crypto.md
@@ -49,7 +49,7 @@ let crypto;
try {
crypto = require('node:crypto');
} catch (err) {
- console.log('crypto support is disabled!');
+ console.error('crypto support is disabled!');
}
```
@@ -67,7 +67,7 @@ let crypto;
try {
crypto = await import('node:crypto');
} catch (err) {
- console.log('crypto support is disabled!');
+ console.error('crypto support is disabled!');
}
```
diff --git a/doc/api/events.md b/doc/api/events.md
index c377c3e71f..7ddd624dd9 100644
--- a/doc/api/events.md
+++ b/doc/api/events.md
@@ -1042,7 +1042,7 @@ process.nextTick(() => {
try {
await once(ee, 'myevent');
} catch (err) {
- console.log('error happened', err);
+ console.error('error happened', err);
}
```
@@ -1067,7 +1067,7 @@ async function run() {
try {
await once(ee, 'myevent');
} catch (err) {
- console.log('error happened', err);
+ console.error('error happened', err);
}
}
@@ -1086,7 +1086,7 @@ const ee = new EventEmitter();
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.error('error', err.message));
ee.emit('error', new Error('boom'));
@@ -1100,7 +1100,7 @@ const ee = new EventEmitter();
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.error('error', err.message));
ee.emit('error', new Error('boom'));