src/vs/workbench/browser/parts/editor/editorPanes.ts/EditorPanes/doShowError
class EditorPanes:	private async doShowError(error: Error, editor: EditorInput, options?: IEditorOptions, context?: IEditorOpenContext): Promise<IOpenEditorResult> {

		// Always log the error to figure out what is going on
		this.logService.error(error);

		// Show as modal dialog when explicit user action
		let errorHandled = false;
		if (options?.source === EditorOpenSource.USER) {

			// Extract possible error actions from the error
			let errorActions: readonly IAction[] | undefined = undefined;
			if (isErrorWithActions(error)) {
				errorActions = error.actions;
			}

			const buttons: string[] = [];
			if (Array.isArray(errorActions) && errorActions.length > 0) {
				for (const errorAction of errorActions) {
					buttons.push(errorAction.label);
				}
			} else {
				buttons.push(localize('ok', 'OK'));
			}

			let cancelId: number | undefined = undefined;
			if (buttons.length === 1) {
				buttons.push(localize('cancel', "Cancel"));
				cancelId = 1;
			}

			const result = await this.dialogService.show(
				Severity.Error,
				localize('editorOpenErrorDialog', "Unable to open '{0}'", editor.getName()),
				buttons,
				{
					detail: toErrorMessage(error),
					cancelId
				}
			);

			// Make sure to run any error action if present
			if (result.choice !== cancelId && Array.isArray(errorActions)) {
				const errorAction = errorActions[result.choice];
				if (errorAction) {
					errorAction.run();
					errorHandled = true; // consider the error as handled!
				}
			}
		}

		// Return early if the user dealt with the error already
		if (errorHandled) {
			return { error };
		}

		// Show as editor placeholder: pass over the error to display
		const editorPlaceholderOptions: IErrorEditorPlaceholderOptions = { ...options };
		if (!isCancellationError(error)) {
			editorPlaceholderOptions.error = error;
		}

		return {
			...(await this.doOpenEditor(ErrorPlaceholderEditor.DESCRIPTOR, editor, editorPlaceholderOptions, context)),
			error
		};
	}