Why is it not possible to catch HTTP error in Angular when server is down?

Viewed 735

There is a REST-service in my Angular 9 to handle all HTTP requests. When I shutdown the REST server there are errors in the console.log() but I'm unable to catch them in the service:

    return this.http.post<any[]>(this.path, data, header).pipe(
        catchError((err: HttpErrorResponse) => {
            console.log("---", err);

            return of(null);
        })
    );

console output is always:

    zone-evergreen.js:2845 HEAD https://SERVER/ net::ERR_CERT_COMMON_NAME_INVALID

Why does this happen and why is catchError being ignorred?

1 Answers
Related