Chaining Http requests catch only on first one
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/common/httpIs this a regression?
NoDescription
Iβm chaining Angular Http request as following. The issue is when the first request fails, I get it on error callback, but if the second one fails, nothing happens.
this.myService.requestOne(this.data)
.pipe(mergeMap(dataOne=>{
return this.myService.requestTwo(dataOne);
}))
.subscribe(dataTwo=>{
this.loading = false;
},
(err)=>{
// this fires when only requestOne get failed
this.loading = false;
});
π Your Environment
Angular Version:
@angular-devkit/architect 0.1001.4
@angular-devkit/build-angular 0.1001.4
@angular-devkit/core 10.1.4
@angular-devkit/schematics 10.1.6
@angular/animations 10.1.5
@angular/cdk 10.2.4
@angular/material 10.2.4
@schematics/angular 10.1.6
@schematics/update 0.1001.4 (cli-only)
rxjs 6.6.3
typescript 4.0.3
Anything else relevant?
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Angular chaining Http requests catch only on first one
I'm chaining Angular Http request as following. The issue is when the first request fails, I get it on error callback, but if...
Read more >Angular chaining Http requests catch only on first one-rx.js
Coding example for the question Angular chaining Http requests catch only on first one-rx.js.
Read more >Chain HTTP Requests in React Using Promises - Pluralsight
By chaining Promises together, you can not only guarantee that one Promise will complete directly after the others prior to it are completed,Β ......
Read more >Promises chaining - The Modern JavaScript Tutorial
A Promise keeps an internal state. It calls the handler wrapped in a try...catch block and stores the error. That is why asynchronous...
Read more >Chaining 3 dependent HTTP request subscriptions one, which ...
As you can see, there are 3 levels of API calls (regular HTTP GET requests with JSON responses) that chain together. The first...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, Iβm closing this ticket based on the comments above - it doesnβt seem to be an issue in the framework. Thank you.
@vahidvdn