mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Detect error inside the executor of SubscribableObserver if it returns a promise.
This commit is contained in:
parent
e76c152bfc
commit
4c4a4f64ce
@ -21,6 +21,12 @@ export class SubscribablePromise<T extends any, P extends any> {
|
|||||||
this.observer.complete(result)
|
this.observer.complete(result)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.catch((result) => {
|
||||||
|
if (Promise.resolve(execution as any) === execution) {
|
||||||
|
this.observer.error(result)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public subscribe(onNext: (next: T) => void) {
|
public subscribe(onNext: (next: T) => void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user