max-mapper / max-mapper/multiplex
Send all Error properties through multiplex, not just the message
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 143
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
It looks like only the `message` property is copied over when an `Error` is sent through multiplex.
```
// index.js line 67
this._multiplex._send(this.channel << 3 | (this.initiator ? 6 : 5), err ? new Buffer(err.message) : null)
```
[It is very common to augment Error objects with additional properties](https://www.joyent.com/developers/node/design/errors). Could we have multiplex copy over the entire Error object (recursively with nested objects)? Currently we lose the majority of the useful information with Errors that have additional properties.
Thanks in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at index.js line 67, where the multiplex send path currently constructs a Buffer from err.message, and inspect how errors and nested properties are represented in the surrounding code. The work is done when an Error sent through multiplex preserves its additional properties recursively, with suitable coverage for the resulting serialized data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100