mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

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

Closed masammut closed 3 years ago

masammut commented 3 years ago

Request type

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 commented 3 years ago

Issue moved to mdn/content #1447 via ZenHub