title: Why is my RxJS subscribe error handler not firing?
body: <p>I am attempting to utilize Angular 2's HTTP methods in a service which is working fine until the server returns an invalid response.  Here's the method code from my service:</p>
  
  <pre><code>getCalcCode(request: CalculatorRequest) {
    this.http.post(this._serviceUrl, JSON.stringify(request), this.options)
      .map((response: Response) =&gt; response.json().returnData as CalculatorResponse)
      .catch((error) =&gt; {
        return Observable.throw(error);
      })
      .subscribe((response: CalculatorResponse) =&gt; {
        if (response.returnCode === '000') {
          console.log('Code is zero!');
        }
      }, (error) =&gt; {
        console.error('Error: : ', error);
      });
  }
  </code></pre>
  
  <p>When the server returns an invalid response, the <code>Map</code> operator returns undefined, therefore, when attempting to access <code>response.returnCode</code> from within my subscribe method, I receive:</p>
  
  <blockquote>
    <p>ERROR TypeError: Cannot read property 'returnCode' of undefined</p>
  </blockquote>
  
  <p>And the asynchronous code simply stops executing...the error function on subscribe is never called (<strong>EDIT: because the server is responding properly and the mapping is working properly, just to the wrong JSON format</strong>).</p>
  
  <p>What can I do to ensure that errors within subscribe are caught from my error handler?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After discussing this in the comments further, what I'm truly asking here is exactly how to catch errors from within my "subscribe" callback?  Will I simply need to use a try/catch block?</p>