MCPcopy Index your code
hub / github.com/didi/mpx / callWithErrorHandling

Function callWithErrorHandling

packages/utils/src/errorHandling.js:8–15  ·  view source on GitHub ↗
(fn, instance, info, args)

Source from the content-addressed store, hash-verified

6}
7
8export function callWithErrorHandling (fn, instance, info, args) {
9 if (!isFunction(fn)) return
10 try {
11 return args ? fn(...args) : fn()
12 } catch (e) {
13 handleError(e, instance, info)
14 }
15}
16
17export function wrapMethodsWithErrorHandling (methods, instance) {
18 // if (process.env.NODE_ENV === 'production') return methods

Callers 14

initSetupMethod · 0.90
initDataMethod · 0.90
initProvideMethod · 0.90
callHookMethod · 0.90
wrappedHookFunction · 0.90
getComponentFunction · 0.90
createEffectFunction · 0.90
usePagePreloadFunction · 0.90
initAppProvidesFunction · 0.90
watchFunction · 0.90
onCleanupFunction · 0.90
jobFunction · 0.90

Calls 3

isFunctionFunction · 0.90
fnFunction · 0.85
handleErrorFunction · 0.70

Tested by

no test coverage detected