Angular httpClient interceptor error handling

前端 未结 5 979
滥情空心
滥情空心 2021-02-15 23:45

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:

<
5条回答
  •  北恋
    北恋 (楼主)
    2021-02-16 00:27

    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

提交回复
热议问题