From c6df7d2bc2b6e5ddf4a9710ece4b07b436b5b755 Mon Sep 17 00:00:00 2001 From: Artem Dragunov Date: Mon, 20 Jan 2025 11:33:56 +0300 Subject: [PATCH] Use console.error() for errors consistently (#7411) 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); } ```