fix sql bindings error message not showing (#17276)

* fix error message not showing

* use utils.getErrorMessage
This commit is contained in:
Kim Santiago
2021-10-06 16:03:40 -07:00
committed by GitHub
parent 5d56e6525b
commit 87baa9c860

View File

@@ -32,7 +32,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
try { try {
getAzureFunctionsResult = await azureFunctionsService.getAzureFunctions(uri.fsPath); getAzureFunctionsResult = await azureFunctionsService.getAzureFunctions(uri.fsPath);
} catch (e) { } catch (e) {
void vscode.window.showErrorMessage(e); void vscode.window.showErrorMessage(utils.getErrorMessage(e));
return; return;
} }
@@ -104,7 +104,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
try { try {
settings = await azureFunctionsUtils.getLocalSettingsJson(path.join(path.dirname(projectUri.fsPath!), constants.azureFunctionLocalSettingsFileName)); settings = await azureFunctionsUtils.getLocalSettingsJson(path.join(path.dirname(projectUri.fsPath!), constants.azureFunctionLocalSettingsFileName));
} catch (e) { } catch (e) {
void vscode.window.showErrorMessage(e); void vscode.window.showErrorMessage(utils.getErrorMessage(e));
return; return;
} }
@@ -164,7 +164,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
} }
} catch (e) { } catch (e) {
// display error message and show select setting quickpick again // display error message and show select setting quickpick again
void vscode.window.showErrorMessage(e); void vscode.window.showErrorMessage(utils.getErrorMessage(e));
} }
// If user cancels out of this or doesn't want to overwrite an existing setting // If user cancels out of this or doesn't want to overwrite an existing setting
// just return them to the select setting quickpick in case they changed their mind // just return them to the select setting quickpick in case they changed their mind
@@ -201,7 +201,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
.withAdditionalProperties({ bindingType: selectedBinding.label }) .withAdditionalProperties({ bindingType: selectedBinding.label })
.send(); .send();
} catch (e) { } catch (e) {
void vscode.window.showErrorMessage(e); void vscode.window.showErrorMessage(utils.getErrorMessage(e));
TelemetryReporter.sendErrorEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding); TelemetryReporter.sendErrorEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding);
return; return;
} }