Angular2 rxjs - switchmap catch error : <p>I'd like to be able to handle any errors that error when calling <code>this.authService.refreshToken()</code>.  Can errors be handled within the switchmap block, or how do I go about handling an error in this case?</p>

<pre><code>post3(endpoint: string, body: string) : Observable&lt;any&gt; {
    if (this.authService.tokenRequiresRefresh()) {
      this.authService.tokenIsBeingRefreshed.next(true);
      return this.authService.refreshToken().switchMap(
        data =&gt; {
          this.authService.refreshTokenSuccessHandler(data);
          if (this.authService.loggedIn()) {
            this.authService.tokenIsBeingRefreshed.next(false);
            return this.postInternal(endpoint, body);
          } else {
            this.authService.tokenIsBeingRefreshed.next(false);
            this.router.navigate(['/sessiontimeout']);
            Observable.throw(data);
          }
        }
      );
    }
    else {
      return this.postInternal(endpoint, body);
    }
  }
</code></pre>
