I'm totally clueless about why error is not firing
this is the code where I call the server
this.userService.createUser(values).subscribe((response)=> {
this.alertService.showConfirm("Usuario creado");
this.dialogRef.close(response);
}),error => this.alertService.showError({message: error.error.message})
this error is the one not firing
create user has the following code
createUser(usuario): Observable<boolean>{
const accessToken = this.webStorageService.getAccessToken();
return this.http.post<boolean>(`${this.usersUrl}?access_token=${accessToken}`, usuario,{ headers: this.headers });
where this.http is HttpClient from AngularCommon and headers is
this.headers = new HttpHeaders().set('Content-Type', 'application/json');
I have a response interceptor that catch every error response, the important code of the interceptor is the following
return throwError(err);
because I have the inteceptor only to do something if the http error is 401, but I'm sending a 400 error I have a console log of err on the interceptor and it catch the error fine, any clue why doesn't it reach the subscribe?
I've tried to remove the whole interceptor and it does not work too, so I assume is not a interceptor problem