In Angular 18, I want to return true or false whether a public PDF exist or not. For example, it should return true for :https://sigesbre.brgm.fr/files/fiches/MDO_AgenceEau/MDO_AgenceEau_FRGG015.pdf
My code is the following, but I land in catchError instead of map :
existFile(path: string): Observable<boolean> { return this.httpClient.get(path, { responseType: 'blob' }).pipe( map(() => { console.log('exists', path); return true; }), catchError((e) => { console.log('does not exist', e); return of(false); }) ); }
