caolan / highland

High-level streams library for Node.js and the browser

Home Page:https://caolan.github.io/highland

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle unhandled errors inside stream

ferronrsmith opened this issue · comments

_([1, 2, 3]).consume(function (err, x, push, next) {
    callToSomeLibraryThatFails();
    if (x === _.nil) {
        push(err, x);
    } else {
            push(err, x);
            next();
    }
});

is there someway to handle an error that might occur inside the stream that prevents the err from being pushed ?