I'm handing errors in my Angular app using RxJS like this:
public downloadInClient(fileName: string) {
return (source: Observable<Blob>) =>
source.pipe(
map((blob: Blob) => {
this.downloadPDF(blob, fileName);
return blob;
}),
catchError((error: any) => {
console.error(error);
this.handleError(error);
return EMPTY;
}),
);
}
Any idea why in local I can see the object error with its fields when an error is caught, but after building and deploying the app, the error is caught in the correct place but when console.error it, is shows itself as undefined?
I have tried to frame all inside a try catch, but because the error is caught before, inside the catchError, the code doesn't arrive to the outside catch.
downloadInClient