mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: use console.error for error case in timers and tls
console.error is more suitable than console.log for error case. PR-URL: https://github.com/nodejs/node/pull/46002 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
aec340b312
commit
fa5b65ea24
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -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();
|
||||
@@ -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();
|
||||
|
||||
+2
-2
@@ -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!');
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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!');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user