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

Function lightweightErrorReport

3p/integration-lib.js:346–359  ·  view source on GitHub ↗

* Reports an error to the server. Must only be called once per page. * Not for use in event handlers. * * We don't use the default error in error.js handler because it has * too many deps for this small JS binary. * * @param {!Error} e * @param {boolean} isCanary

(e, isCanary)

Source from the content-addressed store, hash-verified

344 * @param {boolean} isCanary
345 */
346function lightweightErrorReport(e, isCanary) {
347 new Image().src =
348 urls.errorReporting +
349 '?3p=1&v=' +
350 encodeURIComponent(mode.version()) +
351 '&m=' +
352 encodeURIComponent(e.message) +
353 '&ca=' +
354 (isCanary ? 1 : 0) +
355 '&r=' +
356 encodeURIComponent(document.referrer) +
357 '&s=' +
358 encodeURIComponent(e.stack || '');
359}

Callers 1

draw3pFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected