Skip to content

Commit

Permalink
doc: use console.error for error case in timers and tls
Browse files Browse the repository at this point in the history
console.error is more suitable than console.log for error case.

PR-URL: #46002
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
deokjinkim authored Jan 1, 2023
1 parent 87f541e commit 50744bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ setImmediatePromise('foobar', { signal })
.then(console.log)
.catch((err) => {
if (err.name === 'AbortError')
console.log('The immediate was aborted');
console.error('The immediate was aborted');
});

ac.abort();
Expand All @@ -296,7 +296,7 @@ setTimeoutPromise(1000, 'foobar', { signal })
.then(console.log)
.catch((err) => {
if (err.name === 'AbortError')
console.log('The timeout was aborted');
console.error('The timeout was aborted');
});

ac.abort();
Expand Down
4 changes: 2 additions & 2 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let tls;
try {
tls = require('node:tls');
} catch (err) {
console.log('tls support is disabled!');
console.error('tls support is disabled!');
}
```

Expand All @@ -47,7 +47,7 @@ let tls;
try {
tls = await import('node:tls');
} catch (err) {
console.log('tls support is disabled!');
console.error('tls support is disabled!');
}
```

Expand Down

0 comments on commit 50744bb

Please sign in to comment.