Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.exception() and console.error() are not functionally identical #1447

Closed
1 of 3 tasks
chrisdavidmills opened this issue Jan 18, 2021 · 0 comments · Fixed by #1665
Closed
1 of 3 tasks

console.exception() and console.error() are not functionally identical #1447

chrisdavidmills opened this issue Jan 18, 2021 · 0 comments · Fixed by #1665
Labels
Content:WebAPI Web API docs effort: small This task is a small effort. good first issue A good issue for newcomers to get started with.

Comments

@chrisdavidmills
Copy link
Contributor

@masammut commented on Wed Dec 02 2020

Request type

  • Please close this issue, I accidentally submitted it without adding any details
  • New documentation
  • Correction or update

Details

On the page https://developer.mozilla.org/en-US/docs/Web/API/Console/error it says that:

Note: console.exception() is an alias for console.error(); they are functionally identical.

I have found out that at least on Chrome (Version 86.0.4240.111 64-bit) this is not true because "console.exception()" also throws the exception whereas "console.error()" does not.

Example:

console.log("console.error - Begin");
try {
  nonExistentFunction();
} catch (error) {
  console.error(error);
}
console.log("console.error - End");

console.log("console.exception - Begin");
try {
  nonExistentFunction();
} catch (error) {
  console.exception(error);
}
console.log("console.exception - End"); // <-- Not executed

Example on jsfiddle: https://jsfiddle.net/30z6nkhs/

@chrisdavidmills chrisdavidmills added effort: small This task is a small effort. Content:WebAPI Web API docs good first issue A good issue for newcomers to get started with. labels Jan 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs effort: small This task is a small effort. good first issue A good issue for newcomers to get started with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant