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 {
getAzureFunctionsResult = await azureFunctionsService.getAzureFunctions(uri.fsPath);
} catch (e) {
void vscode.window.showErrorMessage(e);
void vscode.window.showErrorMessage(utils.getErrorMessage(e));
return;
}
@@ -104,7 +104,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
try {
settings = await azureFunctionsUtils.getLocalSettingsJson(path.join(path.dirname(projectUri.fsPath!), constants.azureFunctionLocalSettingsFileName));
} catch (e) {
void vscode.window.showErrorMessage(e);
void vscode.window.showErrorMessage(utils.getErrorMessage(e));
return;
}
@@ -164,7 +164,7 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
}
} catch (e) {
// 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
// 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 })
.send();
} catch (e) {
void vscode.window.showErrorMessage(e);
void vscode.window.showErrorMessage(utils.getErrorMessage(e));
TelemetryReporter.sendErrorEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding);
return;
}