From e9e0bf7d8453d6bb5449df90da07333386b8d954 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Wed, 20 Mar 2019 09:58:56 -0400 Subject: [PATCH] Fixes #275 --- packages/vscode/src/workbench.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/vscode/src/workbench.ts b/packages/vscode/src/workbench.ts index ca06b019..b12becfb 100644 --- a/packages/vscode/src/workbench.ts +++ b/packages/vscode/src/workbench.ts @@ -189,7 +189,19 @@ export class Workbench { } else { config.folderUri = workspace as URI; } - await main(config); + try { + await main(config); + } catch (ex) { + if (ex.toString().indexOf("UriError") !== -1 || ex.toString().indexOf("backupPath") !== -1) { + /** + * Resolves the error of the workspace identifier being invalid. + */ + this.workspace = undefined; + location.reload(); + + return; + } + } const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService; const bounded = this.clipboardContextKey.bindTo(contextKeys); client.clipboard.onPermissionChange((enabled) => {