title: Angular httpClient interceptor error handling
body: <p>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:</p>
  
  <pre><code>export class interceptor implements HttpInterceptor {
      intercept(request: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
          console.log('this log is printed on the console!');
  
          return next.handle(request).do(() =&gt; (err: any) =&gt; {
              console.log('this log isn't');
              if (err instanceof HttpErrorResponse) {
                  if (err.status === 401) {
                      console.log('nor this one!');
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p>on the console log, I also get this:</p>
  
  <blockquote>
    <p>zone.js:2969 GET <a href="http://localhost:8080/test" rel="noreferrer">http://localhost:8080/test</a> 401 ()</p>
    
    <p>core.js:1449 ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: "OK", url: "<a href="http://localhost:8080/test" rel="noreferrer">http://localhost:8080/test</a>", ok: false, …}</p>
  </blockquote>