I want to be able to respond to errors from a call to collectionData. I added a catchError but it never gets called. In fact, the collectionData emits a result with no elements.
export const bundleEpic = action$ => action$.pipe(
ofType(BUNDLES_LOAD),
tap(action => console.log(`Received action: type=${action.type}`)),
switchMap(() => (
collectionData(bundlesRef, 'id')
.pipe(
tap(docs => console.log(`bundleEpic: size = ${docs.length}`)),
map(docs => publicBundlesLoadSuccess(docs)),
catchError(error => from(publicBundlesLoadFail(error))
)
))
)
What is the proper way to handle errors using collectionData?