Skip to content

Commit 541b49d

Browse files
committed
fix(Observable): rethrow errors when syncErrorThrowable and inherit it from destination. Fixes #2813
1 parent c498974 commit 541b49d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Observable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class Observable<T> implements Subscribable<T> {
199199
if (operator) {
200200
operator.call(sink, this.source);
201201
} else {
202-
sink.add(this.source ? this._subscribe(sink) : this._trySubscribe(sink));
202+
sink.add(this.source || !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
203203
}
204204

205205
if (sink.syncErrorThrowable) {

src/Subscriber.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class Subscriber<T> extends Subscription implements Observer<T> {
6868
}
6969
if (typeof destinationOrNext === 'object') {
7070
if (destinationOrNext instanceof Subscriber) {
71+
this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
7172
this.destination = (<Subscriber<any>> destinationOrNext);
7273
(<any> this.destination).add(this);
7374
} else {

0 commit comments

Comments
 (0)