Skip to content

Commit

Permalink
fix(rx-stateful): when handling errors it emitted by default the Erro…
Browse files Browse the repository at this point in the history
…r.message but it should emit the whole error object
  • Loading branch information
michaelbe812 committed Aug 20, 2024
1 parent b729c48 commit 4c6a506
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/rx-stateful/src/lib/rx-stateful$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function deriveInitialValue<T, E>(mergedConfig: RxStatefulConfig<T,E>){

function handleError<T,E>(error: E, mergedConfig: RxStatefulConfig<T, E>, error$$: Subject<RxStatefulWithError<T, E>>){
mergedConfig?.beforeHandleErrorFn?.(error);
const errorMappingFn = mergedConfig.errorMappingFn ?? ((error: E) => (error as any)?.message);
const errorMappingFn = mergedConfig.errorMappingFn ?? ((error: E) => (error as any));
error$$.next({ error: errorMappingFn(error), context: 'error', isLoading: false,
isRefreshing: false, value: null });
return NEVER;
Expand Down

0 comments on commit 4c6a506

Please sign in to comment.