Angular – Catching error after all HTTP retry failed

I am using Angular Service to get data from my API. I implemented retry feature in case of fetching data fails. Now i need to handle the error when all the retries wear out, but im not able to catch it.

Following is my code,

public getInfoAPI(category:string, id:string = "", page:string = "1", limit:string = "10"){
    var callURL : string = '';

    if(!!id.trim() && !isNaN(+id)) callURL = this.apiUrl+'/info/'+category+'/'+id;
    else callURL = this.apiUrl+'/info/'+category;

    return this.http.get(callURL,{
      params: new HttpParams()
        .set('page', page)
        .set('limit', limit)
      retryWhen(errors => errors.pipe(delay(1000), take(10), catchError(this.handleError)))//This will retry 10 times at 1000ms interval if data is not found
// Handle API errors
  handleError(error: HttpErrorResponse) {
    console.log("Who's there?");
    if (error.error instanceof ErrorEvent) {
      // A client-side or network error occurred. Handle it accordingly.
      console.error('An error occurred:', error.error.message);
    } else {
      // The backend returned an unsuccessful response code.
      // The response body may contain clues as to what went wrong,
        `Backend returned code ${error.status}, ` +
        `body was: ${error.error}`);
    // return an observable with a user-facing error message
    return throwError(
      'Something bad happened; please try again later.');

I am succesfully able to retry 10 times with 1 sec delay, but when 10 retries complete, i want unable to catch the error.

enter image description here


I am new to Angular, so if you could suggest improvement in this call you’re welcomed to do so.

Source: New feed
Source Url Angular – Catching error after all HTTP retry failed