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

fix: include stack in browser uncaught error reporting #5107

Merged

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Feb 28, 2024

PR Checklist

Overview

Continues #3952. In summary, this change uses the "newly" available err parameter in onerror to log a nicer stack.

Co-authored-by: Peter Rust peter@cornerstonenw.com

browser-entry.js Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Feb 28, 2024

Coverage Status

coverage: 94.359%. remained the same
when pulling e1aa60d on JoshuaKGoldberg:browser-uncaught-errors
into 2f3fedc on mochajs:master.

@prust
Copy link
Contributor

prust commented Feb 29, 2024

thanks @JoshuaKGoldberg!

@JoshuaKGoldberg
Copy link
Member Author

I hadn't noticed that #5080 did this same thing. Closing in favor of that one. 🚀

@JoshuaKGoldberg
Copy link
Member Author

...and, re-opening per #5080 (comment). 😄

@JoshuaKGoldberg JoshuaKGoldberg restored the browser-uncaught-errors branch March 5, 2024 12:33
@JoshuaKGoldberg JoshuaKGoldberg added the run-browser-test run browser tests on forked PR if code is safe label Mar 12, 2024
@github-actions github-actions bot removed the run-browser-test run browser tests on forked PR if code is safe label Mar 12, 2024
Copy link
Member

@voxpelli voxpelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should go through all the browser polyfilling eventually, but this looks good, only the sinon fix needed.


For future reference / personal reference: Related APIs:

Could perhaps want to move Mocha to this one eventually:

test/unit/throw.spec.js Outdated Show resolved Hide resolved
JoshuaKGoldberg and others added 2 commits June 22, 2024 19:05
Co-authored-by: Pelle Wessman <pelle@kodfabrik.se>
@JoshuaKGoldberg JoshuaKGoldberg merged commit 67a8124 into mochajs:master Jun 22, 2024
24 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the browser-uncaught-errors branch June 22, 2024 23:15
@JoshuaKGoldberg JoshuaKGoldberg added the semver-patch implementation requires increase of "patch" version number; "bug fixes" label Jun 22, 2024
@JoshuaKGoldberg
Copy link
Member Author

This was released in mocha@10.5.0. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch implementation requires increase of "patch" version number; "bug fixes"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug: Browser doesn't include call stack for global uncaught errors
4 participants