Skip to content

Commit b21cd4d

Browse files
committed
Fixes #275
1 parent dc2f1a4 commit b21cd4d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/vscode/src/workbench.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,19 @@ export class Workbench {
189189
} else {
190190
config.folderUri = workspace as URI;
191191
}
192-
await main(config);
192+
try {
193+
await main(config);
194+
} catch (ex) {
195+
if (ex.toString().indexOf("UriError") !== -1 || ex.toString().indexOf("backupPath") !== -1) {
196+
/**
197+
* Resolves the error of the workspace identifier being invalid.
198+
*/
199+
this.workspace = undefined;
200+
location.reload();
201+
202+
return;
203+
}
204+
}
193205
const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService;
194206
const bounded = this.clipboardContextKey.bindTo(contextKeys);
195207
client.clipboard.onPermissionChange((enabled) => {

0 commit comments

Comments
 (0)