**UPDATE: I FOUND THE ISSUE. THE ANSWER IS BELOW**

I have the following code in my service class:

```
public getListById(id:string): Observable<any[]> {
        return this.http.get<any[]>(`${BASE_URL.local}/${id}`).pipe(
            map(obj => obj),
            catchError(error => this.handleError(error))
        )
    }

handleError(error: any): Observable<any> {
        console.log(error)
        this.snackBar.open(
            "Server Error",
            "X"
        )
        return EMPTY;
    }

```

And the following code in my component:

```
this.myService.getListById(id).subscribe(
    res => { doSomethingWith(res) },
    error => { 
        this.noRows = true
        console.log(error)
    },
    () => { this.loading = false }
)

```

When the service calls GET in the Rest address, it is giving a 500 error and I would like do handle it.

But the `catchError()` function in `pipe()`, for some reason, doesn't catch the error and only runs the `() => { this.loading = false }` code inside `subscribe()`.

What am I doing wrong with this bad RxJs module (seriously, I don't like the way that it works with backend requests) that I can't simply handle a request error?

Thank you.

**ANSWER**

I found the issue. Another previous developer defined an **Error Interceptor** that wasn't working as it should.

I deleted the `ErrorInterceptor` and defined a new one. I also fixed the 'providers' property definition in my `app.module.ts`, it wasn't referencing the correct ErrorInterceptor class as it should.