Using `retryWhen` in http requests
<p>I have extended <code>Http</code> class to set default headers and handle errors for all the requests inside an angular2 app, and I would like to use <code>retryWhen()</code> to retry the requests on certain errors.</p>

<p>On which errors should <code>retryWhen</code> retry the request and on which errors should it stop?</p>

<pre><code>@Injectable()
export class WpHttp extends Http {

  constructor(backend: ConnectionBackend,
            defaultOptions: RequestOptions,
            private wpService: WpService) {
    super(backend, defaultOptions);
  }

   get(endpoint: string, args?: QueryArgs): Observable&lt;Response&gt; {

    return super.get(this.getUrl(endpoint, args), this.getOptions())

        /** retry the request after 1 second */
        .retryWhen(error =&gt; error.delay(1000))

        /** timeout 3s
        .timeout(3000 , new Error('delay exceeded'))

        .catch((err) =&gt; {
            if (err.status === 400 || err.status === 422) {
                return Observable.throw(err);
            } 
            else {
                /** Stream errors in WpService */
                this.wpService.errors.next(err);
            }
        })
        .finally(() =&gt; {

        });
   }
}
</code></pre>

<p>And should it be used for <code>post</code>, <code>put</code>, <code>update</code>, <code>delete</code> requests?</p>