Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: using console.error for error cases in crypto and events #45640

Merged
merged 2 commits into from Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Expand Up @@ -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!');
}
```

Expand All @@ -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!');
}
```

Expand Down
8 changes: 4 additions & 4 deletions doc/api/events.md
Expand Up @@ -1041,7 +1041,7 @@ process.nextTick(() => {
try {
await once(ee, 'myevent');
} catch (err) {
console.log('error happened', err);
console.error('error happened', err);
}
```

Expand All @@ -1066,7 +1066,7 @@ async function run() {
try {
await once(ee, 'myevent');
} catch (err) {
console.log('error happened', err);
console.error('error happened', err);
}
}

Expand All @@ -1085,7 +1085,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'));

Expand All @@ -1099,7 +1099,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'));

Expand Down