how can i display an error in the frontend of an angular application?

In the method “handleError”, you are returning a string:

return throwError(
      'Something bad happened; please try again later.');

So, when you subscribe, you’ll receive the string 'Something bad happened; please try again later.'

If you want the subscriber to receive the message, change your handleMessage return value:

return throwError(error);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top