I use middleware for my back-end which processes each exception and produces JSON response which looks as follows:
{"error":"System.Exception: 'You must be logged in to perform this action.'"}
In my Angular app I would like to show a notification carrying the exception text each time the exception occurs, but I'm not entirely sure about how to implement this.
I wonder if should use HttpInterceptor for that - I'm also not quire sure how to register them properly - they should be registered in root.module.ts to work app-wide, right?
Could someone recommend a workaround or provide code examples please?