Implementation:SeleniumHQ Selenium Closure ErrorHandler
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing error handling utilities used by Selenium JavaScript atoms.
Description
goog.debug.ErrorHandler is a vendored copy of the Google Closure Library module. It provides error handling utilities that can wrap functions with try/catch statements, routing exceptions to a configurable error handler function. It implements the EntryPointMonitor interface and can wrap window.setTimeout and window.setInterval for centralized error handling. Errors can optionally be wrapped in ProtectedFunctionError before rethrowing. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/debug/errorhandler.js
- Lines: 1-370
Key Exports
goog.provide('goog.debug.ErrorHandler');
goog.provide('goog.debug.ErrorHandler.ProtectedFunctionError');
// goog.debug.ErrorHandler constructor:
goog.debug.ErrorHandler(handler) // extends goog.Disposable, implements EntryPointMonitor
// Key methods:
goog.debug.ErrorHandler.prototype.wrap(fn)
goog.debug.ErrorHandler.prototype.unwrap(fn)
goog.debug.ErrorHandler.prototype.protectEntryPoint(fn)