@stacktrace-lite/core
    Preparing search index...

    Function installBrowserErrorHooks

    • Installs global browser hooks for error and unhandledrejection.

      Parameters

      • options: BrowserHookOptions = {}

        Configuration for filtering, formatting, and handling stacks.

      Returns void

      • error: Fired when a script throws or a resource fails; ErrorEvent.error may contain an Error object when available.
      • unhandledrejection: Fired when a Promise rejects without a handler; the event’s reason may be an Error or any value.

      The handler parses the stack via parseStack, applies filterStack when provided, and then either calls BrowserHookOptions.onStack or logs a formatted stack using formatStack.

      installBrowserErrorHooks({
      filter: { preset: 'app-only', include: [//src//] },
      format: 'cli', // or 'html'
      onStack(frames, evt) {
      // send to your telemetry backend
      sendToCollector({ frames, kind: evt.type });
      },
      });