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

Method error

third_party/subscriptions-project/swg.js:13994–14015  ·  view source on GitHub ↗

* @param {...*} var_args * @return {!Promise}

(var_args)

Source from the content-addressed store, hash-verified

13992 * @return {!Promise}
13993 */
13994 error(var_args) {
13995 const args = Array.prototype.slice.call(arguments, 0);
13996 return this.microTask_.then(() => {
13997 const error = createErrorVargs.apply(null, args);
13998 if (error.reported) {
13999 return;
14000 }
14001 const img = this.doc_.getWin().document.createElement('img');
14002 img.src =
14003 'https://news.google.com/_/SubscribewithgoogleClientUi/jserror' +
14004 '?error=' +
14005 encodeURIComponent(String(error)) +
14006 '&script=' +
14007 encodeURIComponent('https://news.google.com/swg/js/v1/swg.js') +
14008 '&line=' +
14009 (error.lineNumber || 1) +
14010 '&trace=' +
14011 encodeURIComponent(error.stack);
14012 // Appending this image to DOM is not necessary.
14013 error.reported = true;
14014 });
14015 }
14016}
14017
14018/**

Callers 9

getAmpConfigFunction · 0.45
test-log.jsFile · 0.45
restoreConsoleErrorFunction · 0.45
scope-require.jsFile · 0.45
configurePendingMethod · 0.45
startMethod · 0.45
logDevErrorToConsole_Method · 0.45
constructorMethod · 0.45

Calls 4

applyMethod · 0.80
StringFunction · 0.50
thenMethod · 0.45
getWinMethod · 0.45

Tested by

no test coverage detected