Skip to content

Commit 30011aa

Browse files
committed
Fail gracefully if we can't open the new query file
1 parent 061f347 commit 30011aa

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

extensions/ql-vscode/src/skeleton-query-wizard.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,15 @@ export class SkeletonQueryWizard {
8080
join(this.storagePath, this.folderName, this.fileName),
8181
);
8282

83-
void workspace.openTextDocument(queryFileUri).then((doc) => {
84-
void Window.showTextDocument(doc);
85-
});
83+
try {
84+
void workspace.openTextDocument(queryFileUri).then((doc) => {
85+
void Window.showTextDocument(doc);
86+
});
87+
} catch (e: unknown) {
88+
void this.extLogger.log(
89+
`Could not open example query file: ${getErrorMessage(e)}`,
90+
);
91+
}
8692
}
8793

8894
private workoutStoragePath() {

0 commit comments

Comments
 (0)