Skip to content

Commit

Permalink
fix(Observable): rethrow errors when syncErrorThrowable and inherit i…
Browse files Browse the repository at this point in the history
…t from destination. Fixes #2813
  • Loading branch information
jayphelps committed Dec 5, 2017
1 parent c498974 commit 541b49d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class Observable<T> implements Subscribable<T> {
if (operator) {
operator.call(sink, this.source);
} else {
sink.add(this.source ? this._subscribe(sink) : this._trySubscribe(sink));
sink.add(this.source || !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
}

if (sink.syncErrorThrowable) {
Expand Down
1 change: 1 addition & 0 deletions src/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class Subscriber<T> extends Subscription implements Observer<T> {
}
if (typeof destinationOrNext === 'object') {
if (destinationOrNext instanceof Subscriber) {
this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
this.destination = (<Subscriber<any>> destinationOrNext);
(<any> this.destination).add(this);
} else {
Expand Down

0 comments on commit 541b49d

Please sign in to comment.