Created
August 1, 2018 10:33
-
-
Save whisher/e313c9d08d39d2f875cb278cefaa4fdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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