title: Angular "Http failure response for... 0 Unknown Error" problem again
body: <p>I have been reading a lot of topic about this issue on stackoverflow. Most of the answer saying that this is CORS problem. I am not sure in my case so that's why i ask this question again and need serious help here.</p>
  
  <p>I am developing an Angular app that hit an API every 60 seconds on an Android tablet web browser. The app working perfectly fine. But after couple hours, i started seeing errors:</p>
  
  <pre><code>0-Http failure response for https://theurl.com/api/: 0 Unknown Error
  </code></pre>
  
  <p>The scary part is that it happens randomly, sometime it will happen after 8,9 or 10 hours, sometimes after a day which is so hard for me to debug it. 
  But if i reload the app, it's back to work normally. of course i dont want to do that eveytime it happens and i cant figure it out what is the root problem to fix it.</p>
  
  <p>I was thinking about put a logic in interceptor. whenever i got error status : 0 then reload the app. But i am not sure its good practice..</p>
  
  <p>Any suggestion will be really appreciate or at least a work around. thanks.</p>
  
  <p>// Edit: i am just going to ignore after 5 times retrying when the error status is 0:</p>
  
  <pre><code> intercept(
      request: HttpRequest&lt;any&gt;,
      next: HttpHandler
    ): Observable&lt;
      | HttpSentEvent
      | HttpHeaderResponse
      | HttpProgressEvent
      | HttpResponse&lt;any&gt;
      | HttpUserEvent&lt;any&gt;
      | any
    &gt; {
   return next.handle(request).pipe(
          catchError(err =&gt; {
            if (err instanceof HttpErrorResponse) {
              switch (err.status) {
                case 401:
                  return this.handle401Error(request, next);
                case 0:
                  return this.handleUnknownError(request, next);
                default:
                  return this.router.navigate(['system-error']);
              }
            } else {
              return throwError(err);
            }
          })
        );
      }
     }
  
       private handleUnknownError(request: HttpRequest&lt;any&gt;, next: HttpHandler) {
          return next.handle(request).pipe(
            retryWhen(errors =&gt; {
              return errors.pipe(delay(2000), take(5));
            })
          );
        }
  </code></pre>