File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ import type { ComponentInternalInstance } from './component'
7
7
import { isFunction , isPromise } from '@vue/shared'
8
8
import { warn } from './warning'
9
9
import { VaporLifecycleHooks } from './apiLifecycle'
10
- import { BaseWatchErrorCodes } from '@vue/reactivity'
10
+ import {
11
+ BaseWatchErrorCodes ,
12
+ pauseTracking ,
13
+ resetTracking ,
14
+ } from '@vue/reactivity'
11
15
12
16
// contexts where user provided function may be executed, in addition to
13
17
// lifecycle hooks.
@@ -131,18 +135,19 @@ export function handleError(
131
135
cur = cur . parent
132
136
}
133
137
134
- // TODO: need appContext interface
135
138
// app-level handling
136
- // const appErrorHandler = instance.appContext?.config.errorHandler
137
- // if (appErrorHandler) {
138
- // callWithErrorHandling(
139
- // appErrorHandler,
140
- // null,
141
- // ErrorCodes.APP_ERROR_HANDLER,
142
- // [err, exposedInstance, errorInfo],
143
- // )
144
- // return
145
- // }
139
+ const appErrorHandler = instance . appContext . config . errorHandler
140
+ if ( appErrorHandler ) {
141
+ pauseTracking ( )
142
+ callWithErrorHandling (
143
+ appErrorHandler ,
144
+ null ,
145
+ VaporErrorCodes . APP_ERROR_HANDLER ,
146
+ [ err , instance , errorInfo ] ,
147
+ )
148
+ resetTracking ( )
149
+ return
150
+ }
146
151
}
147
152
logError ( err , type , throwInDev )
148
153
}
You can’t perform that action at this time.
0 commit comments