From eefa92fbfb2d165ffe801e77f7d9fcae150deca6 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Fri, 7 May 2021 11:35:51 -0400 Subject: [PATCH] Fix #123297 --- src/vs/workbench/api/browser/mainThreadCustomEditors.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts index 2c93f870815..66a82a4dade 100644 --- a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts @@ -635,6 +635,7 @@ class MainThreadCustomEditorModel extends ResourceWorkingCopy implements ICustom pendingState.operation.cancel(); }); + let errorMessage = ''; try { const backupId = await pendingState.operation; // Make sure state has not changed in the meantime @@ -653,12 +654,15 @@ class MainThreadCustomEditorModel extends ResourceWorkingCopy implements ICustom if (this._hotExitState === pendingState) { this._hotExitState = HotExitState.NotAllowed; } + if (e.message) { + errorMessage = e.message; + } } if (this._hotExitState === HotExitState.Allowed) { return backupData; } - throw new Error('Cannot back up in this state'); + throw new Error(`Cannot back up in this state: ${errorMessage}`); } }