See window.onerror.