MCPcopy Create free account
hub / github.com/microsoft/SandDance / formatErrors

Function formatErrors

docs/app/js/sanddance-app.js:64380–64396  ·  view source on GitHub ↗
(errors, lines)

Source from the content-addressed store, hash-verified

64378 };
64379}
64380function formatErrors(errors, lines) {
64381 var message = "";
64382 for(var i = 0; i < lines.length; i++){
64383 var line = lines[i];
64384 if (!errors[i + 3] && !errors[i + 2] && !errors[i + 1]) continue;
64385 message += "".concat(line, "\n");
64386 if (errors[i + 1]) {
64387 var error = errors[i + 1];
64388 var segments = error.split(":", 3);
64389 var type = segments[0];
64390 var column = parseInt(segments[1], 10) || 0;
64391 var err = error.substring(segments.join(":").length + 1).trim();
64392 message += padLeft("^^^ ".concat(type, ": ").concat(err, "\n\n"), column);
64393 }
64394 }
64395 return message;
64396}
64397function addLineNumbers(string) {
64398 var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
64399 var delim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ": ";

Callers 1

parseGLSLCompilerErrorFunction · 0.70

Calls 1

padLeftFunction · 0.70

Tested by

no test coverage detected