From fa5b65ea24cfd4e00516c5b50e72fba8d252c9da Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Sun, 1 Jan 2023 15:41:28 +0900 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- doc/api/timers.md | 4 ++-- doc/api/tls.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/timers.md b/doc/api/timers.md index 21d8213eb71763..5fe5a6943adc48 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -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(); diff --git a/doc/api/tls.md b/doc/api/tls.md index 00ba977db7b243..4c0ad5f497ba07 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -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!'); } ```