(error, win)
| 684 | * @param {!Window} win |
| 685 | */ |
| 686 | export 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 |
no test coverage detected