Skip to content

Instantly share code, notes, and snippets.

@sandangel
Last active March 9, 2018 15:57
Show Gist options
  • Save sandangel/711903cd7b9141bad545e9a8571ed6b1 to your computer and use it in GitHub Desktop.
Save sandangel/711903cd7b9141bad545e9a8571ed6b1 to your computer and use it in GitHub Desktop.
Show toast to get user response with error message in Angular HttpClient interceptor
return next.handle(req).pipe(catchError((err, original) => {
return showToast(err.error).pipe(concatMap(toastResult => toastResult ? original : throw(err)));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment