Skip to content

Instantly share code, notes, and snippets.

@whisher
Created August 1, 2018 10:33
Show Gist options
  • Save whisher/e313c9d08d39d2f875cb278cefaa4fdb to your computer and use it in GitHub Desktop.
Save whisher/e313c9d08d39d2f875cb278cefaa4fdb to your computer and use it in GitHub Desktop.
// VECCHIO
.pipe(
tap((event: HttpEvent<any>) => {
if (event instanceof HttpResponse) {
}
}, (err: any) => {
if (err instanceof HttpErrorResponse) {
// do something
}
}));
}
//NUOVO
.pipe(
catchError((event: HttpEvent<any>) => {
if (event instanceof HttpErrorResponse) {
console.log('do something');
}
return throwError(event)
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment