MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / callWithAsyncErrorHandling

Function callWithAsyncErrorHandling

web/main.js:1933–1950  ·  view source on GitHub ↗
(fn, instance, type, args)

Source from the content-addressed store, hash-verified

1931 }
1932}
1933function callWithAsyncErrorHandling(fn, instance, type, args) {
1934 if (isFunction(fn)) {
1935 const res = callWithErrorHandling(fn, instance, type, args);
1936 if (res && isPromise(res)) {
1937 res.catch((err) => {
1938 handleError(err, instance, type);
1939 });
1940 }
1941 return res;
1942 }
1943 if (isArray(fn)) {
1944 const values = [];
1945 for (let i = 0; i < fn.length; i++) {
1946 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1947 }
1948 return values;
1949 }
1950}
1951function handleError(err, instance, type, throwInDev = true) {
1952 const contextVNode = instance ? instance.vnode : null;
1953 const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;

Callers 9

invokeDirectiveHookFunction · 0.85
doWatchFunction · 0.85
callHook2Function · 0.85
injectHookFunction · 0.85
callHook$1Function · 0.85
unmountFunction · 0.85
emitFunction · 0.85
invokeVNodeHookFunction · 0.85
invokerFunction · 0.85

Calls 4

isFunctionFunction · 0.85
callWithErrorHandlingFunction · 0.85
isPromiseFunction · 0.85
handleErrorFunction · 0.85

Tested by

no test coverage detected