Open
Description
lifecycle should handle error
I diff the lifecycle hooks code between ionic and vue,
it is better to wrap hooks with callWithAsyncErrorHandling
as vue do.
no error handle
vue onMounted
will hook onErrorCaptured
, but onIonViewWillEnter
not
- onIonViewWillEnter(async () => {
onMounted(async () => {
await init();
});
common-class.ts:60 Uncaught (in promise) ApiResultError: Order has expired
at UseApiRouteFetcher.ts:107:15
at callHooks (ofetch.03887fc3.mjs:131:15)
at async $fetchRaw2 (ofetch.03887fc3.mjs:299:7)
at async $fetch2 (ofetch.03887fc3.mjs:316:15)
at async fetchTypedResult (typed-fetcher.ts:78:21)
at async ionicFetchResult (ionic-fetcher.ts:45:12)
at async init (prepay.vue?t=1745726446418:133:32)
at async prepay.vue?t=1745726446418:143:7
ionic lifecycle.ts
ionic-framework/packages/vue/src/hooks/lifecycle.ts
Lines 26 to 31 in c5c4d1d
vue apiLifecycle.ts
const res = callWithAsyncErrorHandling(hook, target, type, args)
// ....
return res