I want to call a second observable when the first observable get error 400.
this.service.runTest(resource)
.subscribe(
response => console.log(response),
err => {
this.service.runTest2(resource)
.subscribe(
response => {
setTimeout(()=>{this.resultDisplay = response}, 4000);
},
err => console.log(err)
)
}
);
Try using the catch operator to catch the error and react accordingly: