Skip to content

Commit e540484

Browse files
fix(angular-query): forward queryFn errors to the NgZone (#8842)
* fix(angular-query): forward queryFn errors to the NgZone * fix(angular-query): forward mutationFn errors to the NgZone * refactor: remove wrapping try catches
1 parent a9b073a commit e540484

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/angular-query-experimental/src/create-base-query.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export function createBaseQuery<
117117
observer.getCurrentQuery(),
118118
])
119119
) {
120+
ngZone.onError.emit(state.error)
120121
throw state.error
121122
}
122123
resultFromSubscriberSignal.set(state)

packages/angular-query-experimental/src/inject-mutation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export function injectMutation<
120120
state.error,
121121
])
122122
) {
123+
ngZone.onError.emit(state.error)
123124
throw state.error
124125
}
125126

0 commit comments

Comments
 (0)