angularfire
angularfire copied to clipboard
Errors from methods returning a Promise are not bubbling up when Promise is converted to Observable
trafficstars
In order to achieve consistency, i want to convert methods returning Promises to Observable. However, errors are ignored when trying to catch the error either from the method or from the caller of the method.
See the code below.
createList(newList: NewListDTO) {
const collectionRef = collection(this.db, `lists`);
const newListDoc = addDoc(collectionRef, {
name: newList.name,
uid: newList.uid,
created_at: serverTimestamp(),
});
// return defer(async () => {
// return await newListDoc;
// });
return scheduled(newListDoc, asyncScheduler).pipe(
// FIXME: error is not being caught from firstore addDoc
catchError((err) => {
return throwError(() => err);
}),
);
}
This issue does not seem to follow the issue template. Make sure you provide all the required information.