I am using HttpClient to create a POST request and return Observable to the caller. When a caller subscribes and tries to catch an error, the error is a string instead of the expected HttpErrorResponse as usually seen in the documetation.

I have tried to handle error directly in the calling method using a pipe with a catchError, but it receives the same error as the one above.
Here is the code of my service method
createPartner(partner: Partner) {
return this.http.post(this.publicUrl + "partner", partner).pipe(catchError(this.handleError));
}
handleError(error: HttpErrorResponse) {
console.log(error);
return throwError(error);
}