Sql Binding: Add "Check out pane for more details" when nuget package download fails (#17680)

* check output for more details

* detail error

* wait for result from showerrormessage
This commit is contained in:
Lucy Zhang
2021-11-16 15:01:05 -08:00
committed by GitHub
parent 3cbd2fe5df
commit 3d9f54b0c0
2 changed files with 7 additions and 1 deletions

View File

@@ -519,3 +519,4 @@ export function failedToParse(errorMessage: string) { return localize('failedToP
export function jsonParseError(error: string, line: number, column: number) { return localize('jsonParseError', '{0} near line "{1}", column "{2}"', error, line, column); }
export const moreInformation = localize('moreInformation', "More Information");
export const addPackageReferenceMessage = localize('addPackageReferenceMessage', 'To use SQL bindings, ensure your Azure Functions project has a reference to {0}', sqlExtensionPackageName);
export const addSqlBindingPackageError = localize('addSqlBindingPackageError', 'Error adding Sql Binding extension package to project');

View File

@@ -11,9 +11,11 @@ import { ShellCommandOptions } from './shellExecutionHelper';
export class PackageHelper {
private netCoreTool: NetCoreTool;
private _outputChannel: vscode.OutputChannel;
constructor(outputChannel: vscode.OutputChannel) {
this.netCoreTool = new NetCoreTool(outputChannel);
this._outputChannel = outputChannel;
}
/**
@@ -72,7 +74,10 @@ export class PackageHelper {
});
}
} catch (e) {
void vscode.window.showErrorMessage(e.message);
const result = await vscode.window.showErrorMessage(constants.addSqlBindingPackageError, constants.checkoutOutputMessage);
if (result === constants.checkoutOutputMessage) {
this._outputChannel.show();
}
}
}
}