Created
March 13, 2021 22:42
-
-
Save ssougnez/5adfc926f0d67a8509c4a2f86cf7f402 to your computer and use it in GitHub Desktop.
This file contains 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
import { Observable, throwError } from 'rxjs'; | |
import { catchError } from 'rxjs/operators'; | |
observable | |
.pipe( | |
catchError(err => { | |
console.warn('I want to display this error globally'); | |
return throwError(err); | |
}) | |
) | |
.subscribe({ | |
next: x => console.log(`${x} received`), | |
complete: () => console.log('Completed'), | |
error: err => console.warn(err) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment