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

Function handler

tools/cli/src/webpack/error-handler.js:39–64  ·  view source on GitHub ↗

* @param event {PromiseRejectionEvent|ErrorEvent}

(event)

Source from the content-addressed store, hash-verified

37 * @param event {PromiseRejectionEvent|ErrorEvent}
38 */
39 function handler(event) {
40 var error;
41
42 if ('error' in event) {
43 error =
44 event.error ||
45 (event.message === 'Script error.'
46 ? new SyntaxError(event.message)
47 : new Error(event.message));
48 } else {
49 error = event.reason;
50 }
51
52 console.error('unhandled unrecoverable error', error);
53
54 var shouldCache =
55 // syntax error
56 error && error instanceof SyntaxError;
57
58 if (!shouldCache) {
59 return;
60 }
61
62 event.stopImmediatePropagation();
63 showGlobalErrorPage();
64 }
65
66 function registerGlobalErrorHandler() {
67 if (typeof document !== 'undefined') {

Callers

nothing calls this directly

Calls 2

showGlobalErrorPageFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected