Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49237

How to catch an error from Observable in this scenario?

$
0
0

@Kyrax80 wrote:

Hello guys, I have the following code:

getVideos(): Observable<CategoriaVideoExplicativo[]> {
    return new Observable(observer => {
      this.http.get<CategoriaVideoExplicativo[]>("http://" + "localhost:8080"+ "/PortalPacienteRSHQ/api/v1/videos/get/0")
      .subscribe(categorias => {
        ...
        observer.next(...);
        observer.complete();
      });
    })
  }

With this kind of code how can I handle the error that could occur in this.http.get<CategoriaVideoExplicativo[]>... from where I call this method?
I’ve tried various combinations and none of them worked.

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>