PageSourceSearch

https://townofpelzer.us/assets/lib/window_error_handler-241443ff4e…3e24a93a884b6b7ad08892273025a0f4c51db3fe.js

js townofpelzer.us collected 2026-10-05 08:15:32 UTC 738 bytes, 22 lines download raw bytes

1// Builds the window "error" listener used in controllers/index.js.
2//
3// The guard makes the handler re-entrance safe: if logging the error
4// synchronously triggers another error event (possible on a nearly
5// exhausted stack, where any extra work can overflow again), the nested
6// invocation bails out instead of recursing.
7
8export function createWindowErrorHandler() {
9    let handling = false;
10
11    return function handleWindowError(event) {
12        if (handling) return;
13        handling = true;
14        try {
15            if (event.error instanceof Error) {
16                console.warn("Uncaught error:", event.error.message, event.error.stack);
17            }
18        } finally {
19            handling = false;
20        }
21    };
22};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.