Skip to content

feat: add cause for errorObject #5518

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PinkChampagne17
Copy link

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes.

Motivation / Use-Case

Some code will throw non-error value (e.g., plain objects, strings, or primitives), which will be converted to an instance of Error with the message '[object Object]' and passed to runtimeErrors. This makes filtering errors difficult.

This PR enhances error handling by storing the original thrown value in the Error.cause property to access the raw thrown value for better error identification.

Breaking Changes

No.

Copy link

linux-foundation-easycla bot commented Jun 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: PinkChampagne17 / name: Pink Champagne (804a807)

Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.42%. Comparing base (24a8f62) to head (3c896b6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5518      +/-   ##
==========================================
- Coverage   83.50%   83.42%   -0.09%     
==========================================
  Files          13       13              
  Lines        2031     2033       +2     
  Branches      749      750       +1     
==========================================
  Hits         1696     1696              
- Misses        301      303       +2     
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PinkChampagne17 PinkChampagne17 force-pushed the feat/add-cause-for-error-object branch from 21fe586 to 804a807 Compare June 11, 2025 02:59
@PinkChampagne17
Copy link
Author

Corrected the test case to maintain coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants