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

feat(Observable): unhandled errors are now reported to HostReportErrors #3062

Merged
merged 1 commit into from
Nov 10, 2017
Merged

feat(Observable): unhandled errors are now reported to HostReportErrors #3062

merged 1 commit into from
Nov 10, 2017

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Nov 10, 2017

BREAKING CHANGE: Unhandled errors are no longer caught and rethrown, rather they are caught and scheduled to be thrown, which causes them to be reported to window.onerror or process.on('error'), depending on the environment. Consequently, teardown after a synchronous, unhandled, error will no longer occur, as the teardown would not exist, and producer interference cannot occur

@benlesh benlesh requested a review from kwonoj November 10, 2017 05:49
@rxjs-bot
Copy link

rxjs-bot commented Nov 10, 2017

Warnings
⚠️

❗ Big PR (1)

Messages
📖

(1) : Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

CJS: 1377.9KB, global: 747.4KB (gzipped: 119.7KB), min: 145.2KB (gzipped: 31.3KB)

Generated by 🚫 dangerJS

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.064% when pulling d270fd1 on benlesh:its-a-trap into d58feb7 on ReactiveX:master.

@kwonoj
Copy link
Member

kwonoj commented Nov 10, 2017

Will check this soon.

this.unsubscribe();
this._hostReportError(err);
Copy link
Member

Choose a reason for hiding this comment

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

not sure if this need to be aligned - cases like error / complete we do report error first then unsubscribe, for next we do unsubscribe first then report. Nitpick maybe?

Copy link
Member Author

@benlesh benlesh Nov 10, 2017

Choose a reason for hiding this comment

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

The error is reported asynchronously, so in this case it doesn't matter. However, I think it's probably supposed to be start reporting error then unsubscribe. (if the error reporting was synchronous, which it isn't any more)

Copy link
Member Author

Choose a reason for hiding this comment

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

Improved.

super(destination);
this._tapError = error || noop;
this._tapComplete = complete || noop;
this._tapNext = noop;
Copy link
Member

Choose a reason for hiding this comment

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

83 already assigned into noop, do we need double init?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@kwonoj
Copy link
Member

kwonoj commented Nov 10, 2017

Except few nits I think change looks ok, probably biggest thing we'd like to get opinion is this breaking change itself I guess.

@benlesh
Copy link
Member Author

benlesh commented Nov 10, 2017

opinion is this breaking change itself I guess.

The opinions have already been expressed here

It's part of the spec, and frankly I really am not interested in this discussion again, as you can read the last one was long and heated. We want to align with the proposal.

More specifically, @mattpodwysocki has already weighed in here.

The reason we waited so long is it's a particular nasty refactor and it's a breaking change.

BREAKING CHANGE: Unhandled errors are no longer caught and rethrown, rather they are caught and scheduled to be thrown, which causes them to be reported to window.onerror or process.on('error'), depending on the environment. Consequently, teardown after a synchronous, unhandled, error will no longer occur, as the teardown would not exist, and producer interference cannot occur
@coveralls
Copy link

coveralls commented Nov 10, 2017

Coverage Status

Coverage decreased (-0.1%) to 97.078% when pulling 21450b5 on benlesh:its-a-trap into ad143f1 on ReactiveX:master.

@benlesh benlesh merged commit cd9626a into ReactiveX:master Nov 10, 2017
@kwonoj kwonoj mentioned this pull request Nov 14, 2017
@martinsik
Copy link
Contributor

I feel it's hard for me to imagine what is this change going to cause (for example in Angular apps). I guess it shouldn't change basically anything for me because I don't rely on rethrowing errors but I'm not completely sure.

Maybe this change should be described in MIGRATION.md with some before/after example.

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants