(compileError: dataform.ICompilationError)
| 238 | } |
| 239 | |
| 240 | function formatStackTraceForQuietCompilation(compileError: dataform.ICompilationError): string { |
| 241 | // Show only first 3 or available lines for cleaner error output |
| 242 | // which contains the information on the file where the error occurred and the sufficient metadata for the user to fix the error. For e.g. |
| 243 | // (line: 1) Unexpected identifier <file_path>: <line_number> |
| 244 | // (line: 2) tags: ["<tag_name>"] |
| 245 | // (line: 3) ^^^^ |
| 246 | if (compileError?.message?.includes("Unexpected identifier")) { |
| 247 | if (!compileError.stack) { |
| 248 | return ""; |
| 249 | } |
| 250 | const stackLines = compileError.stack?.split("\n") || []; |
| 251 | return stackLines.slice(0, Math.min(3, stackLines.length)).join("\n"); |
| 252 | } |
| 253 | return ""; |
| 254 | } |
| 255 | |
| 256 | export function printCompiledGraphErrors(graphErrors: dataform.IGraphErrors, quietCompilation: boolean) { |
| 257 | if (graphErrors.compilationErrors && graphErrors.compilationErrors.length > 0) { |
no outgoing calls
no test coverage detected