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

Method error_

src/service/action-impl.js:655–664  ·  view source on GitHub ↗

* @param {string} message * @param {?Element=} opt_element * @private

(message, opt_element)

Source from the content-addressed store, hash-verified

653 * @private
654 */
655 error_(message, opt_element) {
656 if (opt_element) {
657 // reportError() supports displaying the element in dev console.
658 const e = user().createError(`[${TAG_}] ${message}`);
659 reportError(e, opt_element);
660 throw e;
661 } else {
662 user().error(TAG_, message);
663 }
664 }
665
666 /**
667 * @param {!ActionInvocation} invocation

Callers 2

invokeActionMethod · 0.95
invoke_Method · 0.95

Calls 4

userFunction · 0.90
reportErrorFunction · 0.90
createErrorMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected