Apparently, this mechanism invokes any window.onerror or window.addEventListener("error") handlers defined, whereas console.error(..)only reports to the console. That's probably useful enough to detect and invoke if the environment supports it, falling back to console.error otherwise.
https://developer.mozilla.org/en-US/docs/Web/API/reportError
Apparently, this mechanism invokes any
window.onerror
orwindow.addEventListener("error")
handlers defined, whereasconsole.error(..)
only reports to the console. That's probably useful enough to detect and invoke if the environment supports it, falling back toconsole.error
otherwise.