MCPcopy Create free account
hub / github.com/toeverything/AFFiNE / registerGlobalErrorHandler

Function registerGlobalErrorHandler

tools/cli/src/webpack/error-handler.js:66–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 }
65
66 function registerGlobalErrorHandler() {
67 if (typeof document !== 'undefined') {
68 globalThis.addEventListener('unhandledrejection', handler);
69 globalThis.addEventListener('error', handler);
70
71 return function () {
72 globalThis.removeEventListener('unhandledrejection', handler);
73 globalThis.removeEventListener('error', handler);
74 };
75 }
76
77 return null;
78 }
79
80 function unregisterRegisterGlobalErrorHandler(fn) {
81 if (typeof fn === 'function') {

Callers 1

error-handler.jsFile · 0.85

Calls 2

addEventListenerMethod · 0.80
removeEventListenerMethod · 0.80

Tested by

no test coverage detected