[SQL-Migration] Improve error message for failed migration service download (#22846)

Add troubleshooting links to error message when SQL-Migration fails to download the MigrationService as seen in this issue: #22558

---------

Co-authored-by: Akshay Mata <akma@microsoft.com>
This commit is contained in:
AkshayMata
2023-05-01 13:24:35 -07:00
committed by GitHub
parent 7b2a07befd
commit af6f9089f7

View File

@@ -78,13 +78,23 @@ export class ServiceClient {
} }
public async downloadBinaries(context: vscode.ExtensionContext, rawConfig: Buffer): Promise<string> { public async downloadBinaries(context: vscode.ExtensionContext, rawConfig: Buffer): Promise<string> {
const config = JSON.parse(rawConfig.toString()); try {
config.installDirectory = path.join(context.extensionPath, config.installDirectory); const config = JSON.parse(rawConfig.toString());
config.proxy = vscode.workspace.getConfiguration('http').get('proxy'); config.installDirectory = path.join(context.extensionPath, config.installDirectory);
config.strictSSL = vscode.workspace.getConfiguration('http').get('proxyStrictSSL', true); config.proxy = vscode.workspace.getConfiguration('http').get('proxy');
const serverdownloader = new ServerProvider(config); config.strictSSL = vscode.workspace.getConfiguration('http').get('proxyStrictSSL', true);
serverdownloader.eventEmitter.onAny(this.generateHandleServerProviderEvent()); const serverdownloader = new ServerProvider(config);
return serverdownloader.getOrDownloadServer(); serverdownloader.eventEmitter.onAny(this.generateHandleServerProviderEvent());
return serverdownloader.getOrDownloadServer();
}
catch (error) {
const errorStr = localize('downloadingServiceFailed', "Failed to download binaries for {0}. Use the following link to troubleshoot: {1}", constants.serviceName, "https://aka.ms/dms-migrations-troubleshooting#azure-data-studio-limitations");
const errorStrWithLink = localize('downloadingServiceFailedWithLinkMarkup', "Failed to download binaries for {0}. Use this [link to troubleshoot]({1}).", constants.serviceName, "https://aka.ms/dms-migrations-troubleshooting#azure-data-studio-limitations");
this.outputChannel.appendLine(errorStr);
void vscode.window.showErrorMessage(errorStrWithLink);
logError(TelemetryViews.SqlServerDashboard, errorStr, error);
throw error;
}
} }
private createClientOptions(): ClientOptions { private createClientOptions(): ClientOptions {