MCPcopy
hub / github.com/ampproject/amphtml / reportErrorToAnalytics

Function reportErrorToAnalytics

src/error-reporting.js:686–701  ·  view source on GitHub ↗
(error, win)

Source from the content-addressed store, hash-verified

684 * @param {!Window} win
685 */
686export function reportErrorToAnalytics(error, win) {
687 // Currently this can only be executed in a single-doc mode. Otherwise,
688 // it's not clear which ampdoc the event would belong too.
689 if (Services.ampdocServiceFor(win).isSingleDoc()) {
690 const vars = {
691 'errorName': error.name,
692 'errorMessage': error.message,
693 };
694 triggerAnalyticsEvent(
695 getRootElement_(win),
696 'user-error',
697 vars,
698 /** enableDataVars */ false
699 );
700 }
701}
702
703/**
704 * @param {!Window} win

Callers 3

reportErrorForWinFunction · 0.85

Calls 3

triggerAnalyticsEventFunction · 0.90
getRootElement_Function · 0.85
isSingleDocMethod · 0.45

Tested by

no test coverage detected