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:
Deokjin Kim authored and Juan José Arboleda committed 2023-01-31 08:04:12 -05:00
1 parent aec340b312
commit fa5b65ea24
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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
View File
@@ -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!');
}
```