Skip to content

Commit fa5b65e

Browse files
deokjinkimjuanarbol
authored andcommitted
doc: use console.error for error case in timers and tls
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>
1 parent aec340b commit fa5b65e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/api/timers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ setImmediatePromise('foobar', { signal })
278278
.then(console.log)
279279
.catch((err) => {
280280
if (err.name === 'AbortError')
281-
console.log('The immediate was aborted');
281+
console.error('The immediate was aborted');
282282
});
283283

284284
ac.abort();
@@ -296,7 +296,7 @@ setTimeoutPromise(1000, 'foobar', { signal })
296296
.then(console.log)
297297
.catch((err) => {
298298
if (err.name === 'AbortError')
299-
console.log('The timeout was aborted');
299+
console.error('The timeout was aborted');
300300
});
301301

302302
ac.abort();

doc/api/tls.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let tls;
2929
try {
3030
tls = require('node:tls');
3131
} catch (err) {
32-
console.log('tls support is disabled!');
32+
console.error('tls support is disabled!');
3333
}
3434
```
3535

@@ -47,7 +47,7 @@ let tls;
4747
try {
4848
tls = await import('node:tls');
4949
} catch (err) {
50-
console.log('tls support is disabled!');
50+
console.error('tls support is disabled!');
5151
}
5252
```
5353

0 commit comments

Comments
 (0)