From 4037f6e136e0feb009fe3ce21d5955cdc5714d2e Mon Sep 17 00:00:00 2001 From: Artem Dragunov Date: Sat, 18 Jan 2025 12:05:03 +0300 Subject: [PATCH] Use console.error() for errors consistently In all examples in this document errors are logged by using `console.error()` method And it's unclear why in promise-based part we have different strategy Signed-off-by: Artem Dragunov --- .../en/learn/manipulating-files/reading-files-with-nodejs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md b/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md index b3593bd6a6753..d30df9fdfd9ff 100644 --- a/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md +++ b/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md @@ -66,7 +66,7 @@ async function example() { const data = await fs.readFile('/Users/joe/test.txt', { encoding: 'utf8' }); console.log(data); } catch (err) { - console.log(err); + console.error(err); } } example(); @@ -79,7 +79,7 @@ try { const data = await fs.readFile('/Users/joe/test.txt', { encoding: 'utf8' }); console.log(data); } catch (err) { - console.log(err); + console.error(err); } ```