* Renders one line of error output. * @param {string} filenameOrUrl * @param {!Object} error * @return {string}
(filenameOrUrl, error)
| 158 | * @return {string} |
| 159 | */ |
| 160 | function 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. |
no test coverage detected