[whatwg/streams] Use e => t.error(e) than t.error for catching exceptions in a then-callback (#479)

In unittests, we have `.catch()` call like this to report unexpected exceptions up to the test fixture:

```
  writer.close().then(() => {
  })
  .catch(t.error);
```

This doesn't tell us whether this happened but instead shows a message like this:

```
not ok 1 aaa
  ---
    operator: fail
    at: process._tickCallback (internal/process/next_tick.js:103:7)
  ...
```

The same for `t.error.bind(t)`.

If we use `e => t.error(e)`, we see stack info:

```
not ok 1 aaa
  ---
    operator: fail
    at: writer.close.then.catch.e (/usr/local/google/home/tyoshino/whatwgstreams/reference-implementation/test/writable-stream.js:59:17)
  ...
```


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/479

Received on Thursday, 14 July 2016 09:29:53 UTC