after reading the documentation on angular about http client error handling, I still don\'t understand why I don\'t catch a 401 error from the server with the code below:
It is off top, but Angular has better opportunity handle errors than interceptor.
You can implement your own ErrorHandler.
https://angular.io/api/core/ErrorHandler