MCPcopy
hub / github.com/vuejs/core / callWithErrorHandling

Function callWithErrorHandling

packages/runtime-core/src/errorHandling.ts:70–81  ·  view source on GitHub ↗
(
  fn: Function,
  instance: ComponentInternalInstance | null | undefined,
  type: ErrorTypes,
  args?: unknown[],
)

Source from the content-addressed store, hash-verified

68export type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes
69
70export function callWithErrorHandling(
71 fn: Function,
72 instance: ComponentInternalInstance | null | undefined,
73 type: ErrorTypes,
74 args?: unknown[],
75): any {
76 try {
77 return args ? fn(...args) : fn()
78 } catch (err) {
79 handleError(err, instance, type)
80 }
81}
82
83export function callWithAsyncErrorHandling(
84 fn: Function | Function[],

Callers 7

warnFunction · 0.90
flushJobsFunction · 0.90
setRefFunction · 0.90
setupStatefulComponentFunction · 0.90
compatModelEmitFunction · 0.90
handleErrorFunction · 0.85

Calls 2

handleErrorFunction · 0.85
fnFunction · 0.50

Tested by

no test coverage detected