max-mapper / max-mapper/multiplex

Send all Error properties through multiplex, not just the message

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.