title: Ionic 2: how to get error from created Observable?
body: <p>I have defined following function:</p>
  
  <pre><code> searchProducts(searchText: string){
       return Observable.create(observer =&gt; {
             return this._http.get(this._global.baseUrl + "/products/search/searchProducts?search=" + searchText)
              .map(res =&gt; res.json())
                  .subscribe(data =&gt; {
                          observer.next(data);    
                          observer.complete();
  
                  },
                  err =&gt; {
                      return Observable.throw(err); // this statement is called
                      });
          });   
    }
  </code></pre>
  
  <p>here is the calling statement:</p>
  
  <pre><code>this.productService.searchProducts(this.searchItem)
                  .subscribe(products =&gt; {
                    console.log(products);
                  },
                  err =&gt; {
                   console.log(err); // this statement is not getting called
                  });
  </code></pre>
  
  <p><strong>Problem:</strong> When getting products from server, the subscribe data callback is called but when getting error(say for <strong>network connection timeout or network error</strong>),err callback is not getting called.</p>
  
  <p>I'm completely exhausted with trying or finding solution, Could somebody help?</p>