i'm making Angular app which has communication with backend app.
The backend app return me status OK - "200" or few errors, eg. "401, 402, 422", and some others.
I would like to catch the error code and base in it display correct information to end user.
My code is simple:
getClient() {
this.idHubResponse = this.http.getClient(this.client.clientId).subscribe(
(data) => {
this.idHubResponse = data;
},
error => {
console.log(error)
}
)
}
Coule you please help me to make switch base on error code?
Thanks