Hi guys, I have the following code in a small test:
constructor(public navCtrl: NavController, public http: HTTP, public http2: HttpClient) {
this.a().subscribe(() => {
}, () => console.log("error"))
}
a(): Observable<any> {
return new Observable(observer => {
this.http.get("d", {}, {}).then(() => {
observer.next(1);
observer.complete();
})
})
}
How can I get the , () => console.log("error") in the subscription be executed when an exception occurs in the promise?.
Thanks.