Hi all,
I have facing one issue regarding the API. I will get details of media file in database then with that details i ll get id for the media file with that id I’ll get a media file from s3. And that path is directly given in html. In that case if the media file is not there the media ll not load there.
I want to handle error for that HTTP get request so that if the media file is not there i can load a new screen to give a better user experience.
My doubt is whether i can handle it in the normal way of error handling method or there is any other better solution for this.
Can anyone help me out, Thanks.
HTML
<img [src]=“getContentURL(Profilecontents.id)” id=“imag{{Profilecontents.id}}” class=“image” alt="">
TS
contentID is media file id.
this.contentURL will have the http link
ex: http://www.example.com/contentID
getContentURL(contentID: string) {
return this.contentURL + contentID;
}