MCPcopy Create free account
hub / github.com/ampproject/amphtml / errorLine

Function errorLine

validator/cpp/engine/wasm/validator.js:160–169  ·  view source on GitHub ↗

* Renders one line of error output. * @param {string} filenameOrUrl * @param {!Object} error * @return {string}

(filenameOrUrl, error)

Source from the content-addressed store, hash-verified

158 * @return {string}
159 */
160function errorLine(filenameOrUrl, error) {
161 const line = error.line ?? 1;
162 const col = error.col ?? 0;
163 let errorLine = `${uriUtils.removeFragment(filenameOrUrl)}:${line}:${col} ${
164 renderErrorMessage(error)}`;
165 if (error.specUrl) {
166 errorLine += ` (see ${error.specUrl})`;
167 }
168 return errorLine;
169}
170
171/**
172 * Log validation result to the console, distinguishing warnings and errors.

Callers 1

logValidationResultFunction · 0.85

Calls 1

renderErrorMessageFunction · 0.85

Tested by

no test coverage detected