Currently developing a site with the Angular framework I found myself facing a situation that confuses me and makes me wonder.
Indeed, like the majority of websites / applications in 2020, the user has the possibility to identify himself to his account in order to access his personal information.
Having already developed a Flutter application to train myself, I had set up an identification system via login/password using calls to an API.
This call is visible in the image below. As you can see in this picture, I retrieve the API response thanks to an await on the POST request.
Then I made a switch on the statusCode of my answer.
And this is where my question comes. I thought I'd take the same thought for my Angular site, but a "problem" arises.
When I set up this "method" under Angular, if I enter bad user information, I don't really get an answer, but the browser tells me that there was an error.
You will see the different scenarios in the two captures below.
My question is finally "simple":
Why can I switch on Flutter response's statuCode & not in Angular ? more precisely, why are the 400 answers considered as errors in Angular and not in Flutter?
Simply a difference in implementation between the 2 frameworks?

