Skip to content

Commit

Permalink
fix: ensure compile error is parsed correctly (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmmmwh committed Feb 7, 2022
1 parent 8c39623 commit 45db3bd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions overlay/components/CompileErrorTrace.js
Expand Up @@ -20,16 +20,15 @@ ansiHTML.setColors(theme);
function CompileErrorTrace(document, root, props) {
const errorParts = props.errorMessage.split('\n');
if (errorParts.length) {
const errorMessage = errorParts
.splice(1, 1)[0]
// Strip filename from the error message
.replace(/^(.*:)\s.*:(\s.*)$/, '$1$2');

if (errorParts[0]) {
errorParts[0] = utils.formatFilename(errorParts[0]);
}

errorParts.unshift(errorMessage);
const errorMessage = errorParts.splice(1, 1)[0];
if (errorMessage) {
// Strip filename from the error message
errorParts.unshift(errorMessage.replace(/^(.*:)\s.*:(\s.*)$/, '$1$2'));
}
}

const stackContainer = document.createElement('pre');
Expand Down

0 comments on commit 45db3bd

Please sign in to comment.