fix: handle frontend error events without an Error object

Merged
FL
3d ago
+93-6

Closes #7482.

window.onerror read error.name and error.message unconditionally. Some error events have no Error object, such as the benign ResizeObserver loop notification, so the handler threw and nothing reached handle_frontend_exception.

When there is no Error object, the handler now reports the message plus url:line:column instead. The existing path is unchanged when an Error is present.

Added a test to state_js.test.mjs for the no-Error case (the existing setup gained a react override so the hook can be exercised). node --experimental-vm-modules --test tests/units/compiler/state_js.test.mjs passes locally, 19/19. I did not run the full test suite or lint locally; CI will.

News fragment included.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)