webpack-dev-server
webpack-dev-server copied to clipboard
feat: add `cause` for `errorObject`
- [ ] This is a bugfix
- [x] 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.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: PinkChampagne17 / name: Pink Champagne (dfb0050fb26b7d66d708b4355867a94c56131f5f)
- :white_check_mark: login: alexander-akait / name: Alexander Akait (cff2809457cbb3822215e5ae3d84b79dc6b4953f)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.53%. Comparing base (
3f3d124) to head (cff2809). Report is 2 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #5518 +/- ##
==========================================
+ Coverage 83.42% 83.53% +0.11%
==========================================
Files 13 13
Lines 2033 2035 +2
Branches 749 750 +1
==========================================
+ Hits 1696 1700 +4
+ Misses 303 301 -2
Partials 34 34
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Corrected the test case to maintain coverage.