Skip to content

Commit

Permalink
Use console.error() for errors consistently (#7411)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dragunovartem99 authored Jan 20, 2025
1 parent 02f5a3e commit c6df7d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
```

Expand Down

0 comments on commit c6df7d2

Please sign in to comment.