Unverified Commit 35049cd8 authored by Nadim Kobeissi's avatar Nadim Kobeissi 💾
Browse files

Handle invalid models and show errors when attempting to analyze/visualize.

parent 6c775f82
......@@ -76,7 +76,7 @@ export default class AnalysisProvider {
static verify(editor: vscode.TextEditor) {
if (analysisActive) {
vscode.window.showInformationMessage("Verifpal: Analysis is already running.");
vscode.window.showErrorMessage("Verifpal: Analysis is already running.");
return;
}
let fileContents = editor.document.getText();
......@@ -127,6 +127,9 @@ export default class AnalysisProvider {
}
});
}
}).catch((err) => {
analysisActive = false;
vscode.window.showErrorMessage("Verifpal: Your model is invalid and cannot be analyzed or visualized. Check for syntax errors.");
});
}
}
\ No newline at end of file
......@@ -43,6 +43,8 @@ export default class DiagramProvider {
diagramHtml = diagramHtml.replace("$$MODELNAME$$", modelName);
diagramHtml = diagramHtml.replace("$$DIAGRAM$$", result);
this.webviewPanel.webview.html = diagramHtml;
}).catch((err) => {
vscode.window.showErrorMessage("Verifpal: Your model is invalid and cannot be analyzed or visualized. Check for syntax errors.");
});
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment