MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / emitError

Function emitError

host/dom/src/index.js:17–25  ·  view source on GitHub ↗
(where, e)

Source from the content-addressed store, hash-verified

15 let errorMsg = null;
16 // Surfaces async errors (listener throws, observer callbacks, swallowed promise rejections) to Python. Falls back to console.error if no consumer bound via bind_global_error.
17 const emitError = (where, e) => {
18 if (errorMsg) ctx.pushEvent(JSON.stringify({
19 msg: errorMsg,
20 where,
21 error: (e && e.message) ? e.message : String(e),
22 stack: (e && e.stack) ? e.stack : undefined,
23 }));
24 else console.error(`[dom:${where}]`, e);
25 };
26 const ctxPlus = { ...ctx, emitError };
27 return Object.assign(
28 {},

Callers 6

animations.jsFile · 0.85
media.jsFile · 0.85
forms.jsFile · 0.85
platform.jsFile · 0.85
listenerFunction · 0.85
observers.jsFile · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected