title: rxjs error handling with catchError and retry
body: <p>I am trying to catch the errors in rxjs using the catchError operator und want to retry 3 time only if I get an <code>errno=215</code></p>
  <pre class="lang-js prettyprint-override"><code>return this.httpService.post(url, data).pipe(
    tap(() =&gt; {
      console.log(`some debugging info`);
    }),
  
    map((response) =&gt; responseAdaptor(response)),
    retryWhen((error) =&gt; {
      return error.pipe(
        scan((acc, error) =&gt; {
          // RETRY ONLY IF ERROR error.errno == 215
  
          if (acc &gt; 2) throw error;
  
          return acc + 1;
        }, 0),
        delay(1000)
      );
    }),
    catchError((error) =&gt; {
      console.log(error);
  
      // Here I want the use `throwError`
  
      return of({ error: error.response });
    })
  );
  </code></pre>
  <p>Here is what I tried but unfortunately no idea how to combine scan counter and errno.</p>