jprichardson / jprichardson/node-death

Fails with piping

Open
#6 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
182
Forks
7
PR merge metrics
No merged PRs in 30d

Description

$ node script.js | tee script.log
^Cevents.js:163
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:1050:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:814:14)

The script is:

var ON_DEATH = require('death'); //this is intentionally ugly

ON_DEATH(function(signal, err) { console.log('croak'); })

setTimeout(function () {}, 10000);

node-cleanup doesn't call my handler either, but at least doesn't display this ugly error message :)

Contributor guide

No contributing guide indexed for this repository

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 by reproducing the reported node script.js | tee script.log command using the provided script.js example and observe the EPIPE output after interruption. Trace the behavior from that reproduction and verify that piping and interrupting the process no longer produces the unhandled error while the cleanup handler's behavior is documented or preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.