title: TypeScript/Angular try catch, any error in try block not going to catch block
body: <p>I am using Angular and TypeScript.
  I have used try catch construct for error handling in case of API call.
  If any error occurs in try block it is simply NOT going to catch block.
  App terminates there only.</p>
  
  <p>I have tried using <code>throw</code> as well. 
  Here is a sample code snippet,</p>
  
  <pre><code>try {
  
    this.api.getAPI(Id).subscribe( // this.api is my api service and getAPI is present there
      (data: any) =&gt; {
        if (data == null) {
          throw 'Empty response';
        }
      },
      (error: HttpErrorResponse) =&gt; {
        console.log(error);
      };
  
  } catch(e) {
    console.log(e); 
  }
  </code></pre>
  
  <p>in some cases 'data' from API returns 'null', 
  but throw is not going to catch block
  ALSO, tried without throw, it gives null error for 'data' ... in that case also not going to catch block.</p>