Skip to content

Commit 1330568

Browse files
author
Yanni Pang
committed
add error message on invalid api connection
1 parent 351f58c commit 1330568

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/commands/xmlToUdl.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export async function previewXMLAsUDL(textEditor: vscode.TextEditor, auto = fals
1313
if (notIsfs(uri) && uri.path.toLowerCase().endsWith("xml") && textEditor.document.lineCount > 2) {
1414
if (exportHeader.test(textEditor.document.lineAt(1).text)) {
1515
const api = new AtelierAPI(uri);
16-
if (!api.active) return;
16+
if (!api.active) {
17+
vscode.window.showErrorMessage(
18+
"Unsuccessful connection to the server. Please check your server connection settings.",
19+
"Dismiss"
20+
);
21+
return;
22+
}
1723
try {
1824
// Convert the file
1925
const udlDocs: { name: string; content: string[] }[] = await api

0 commit comments

Comments
 (0)