Hi Reza,

What do you want to return instead of the error? If you know that, you can 
return that from the catch block. Also, you can do the logging from within 
the catch block.

setWSAddressProvider() : Observable<string[]> {
 return this.http.get('badUrl')
   .map((res:Response) => {
      this.address = res.text();
      return [res.text()];
 });
 .catch((error:any) => {
     console.log('error:', error) 
     return Observable.from({})
 });
}

The catch will "swallow" the error.


Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to