Closed lselden closed 5 years ago
Also found this problem. This is due to ipcRenderer will serialize the paramter passed in. And error object can't be serialized properly.
https://electronjs.org/docs/api/ipc-renderer
@sindresorhus is it possible we can merge this please?
You also need to deserialize the serialized error back to an proper error type. Should be done by adding a .deserialize()
method to https://github.com/sindresorhus/serialize-error and then use that here. Then do a PR.
@issuehunt has funded $50.00 to this issue.
I'm not actively working on a project that would use this, but may get to it in the future...if anyone else wants to take it on they're 100% welcome to do so.
@issuehunt has funded $40.00 to this issue.
I have used #22 in my project, please check it.
@sindresorhus has rewarded $81.00 to @jackple. See it on IssueHunt
In answerRenderer and answerMain errors get passed directly to electron ipc, which serializes Errors as plain objects (https://github.com/electron/electron/issues/7956)
I made a patch that uses your serialize-errors library, but didn't create a pull request because I'm not sure my changes to the test fixtures are up to snuff.
patch: https://github.com/lselden/electron-better-ipc/commit/1f3d72ec5eb1e68d47fbc2454a663391d509fcce
IssueHunt Summary
#### [ jackple](https://issuehunt.io/u/jackple) has been rewarded. ### Backers (Total: $90.00) - [ issuehunt](https://issuehunt.io/u/issuehunt) ($90.00) ### Submitted pull Requests - [#22 error transmit](https://issuehunt.io/r/sindresorhus/electron-better-ipc/pull/22) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/electron-better-ipc/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)