* @param {...*} var_args * @return {!Promise}
(var_args)
| 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 | /** |
no test coverage detected