GoogleChromeLabs / GoogleChromeLabs/comlink
Use `serialize-error` for error serialization
Open
- Dominant language
- TypeScript
- Stars
- 12.8k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
If you are using custom error classes with custom properties or even more or less standard [`cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) then you would loose some data here: https://github.com/GoogleChromeLabs/comlink/blob/4ba8162f6c28fb1bf53b491565ef9a3ae42b72d3/src/comlink.ts#L249-L256
Instead I'm proposing to use `serialize-error` that works better then what we have currently.
I can create PR if this is approved.
Meanwhile you can do this as a [workaround](https://stackoverflow.com/a/72687976/1798418)
Contributor guide
Assessment
This issue has not been assessed yet.