Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow onFinished to turn off default endOnError behavior. #534

Merged
merged 1 commit into from
Sep 6, 2016

Conversation

vqvu
Copy link
Collaborator

@vqvu vqvu commented Sep 5, 2016

Fixes #532.

Allows implementations of onFinished (when constructing a Highland stream from a Readable) to turn off the default behavior via continueOnError.

 _(req, function (req, callback) {
     req.on('error', callback);
     return {
         onDestroy: function () {
             req.removeListener('error', callback);
         },
         continueOnError: true
     };
 }).pipe(writable);

var error1 = new Error('error1');
var error2 = new Error('error2');
var s = _(rs, function (_rs, callback) {
setTimeout(function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is _rs just a placehlder value here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The linter doesn't like it when I shadow variables in functions. Both _rs and rs should reference the same Readable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Makes sense.

@vqvu vqvu merged commit 5155157 into caolan:master Sep 6, 2016
@vqvu vqvu deleted the from-readable-multi-error branch September 6, 2016 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants