How can I trigger my observable initialization when receiving a 404 response from the API? The code snippet below is not working as expected.
const urlParams = { email: this.email };
this.voicesProfileObservable$ = this.service.request<any>(
AVAILABLE_SERVICES.GET_USER_PROFILE_VOICES.ID,
{},
{ urlParams }
).pipe(
catchError((error) => {
this.voicesProfileObservable$ = Observable.of({
aboutSectionType: '',
aboutCustomizedDescription: '',
showSpacesFollowed: true,
showBadgesEarned: true,
showMobileNumber: true,
showOfficeNumber: false,
showEmail: true,
showSlackHandle: false,
video: {},
socialLinks: [],
personalLinks: [],
});
return throwError(error);
}))