Added error message to validate connect params. (#1660)

* Added error message to validate connect params.

* removed connectionParam == null as ConnnectionCompleteParams cannot be nulled.

* Added ValidateConnectParams to other connection services

* removed message from error

* reverted change to connectionServiceCore

* added updated message

* restore null and added errormessage to GetConnectionCompleteParams

* fix for sr.xlf

* fix for tab

* another fix to tabs

* added message to connection complete error

* small fix
This commit is contained in:
Alex Ma
2022-08-30 14:24:44 -07:00
committed by GitHub
parent 93b7a4763b
commit 54c1d0418a
3 changed files with 31 additions and 9 deletions

View File

@@ -319,20 +319,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
/// null upon validation success</returns>
public ConnectionCompleteParams ValidateConnectParams(ConnectParams connectionParams)
{
string paramValidationErrorMessage;
if (connectionParams == null)
{
return new ConnectionCompleteParams
{
Messages = SR.ConnectionServiceConnectErrorNullParams
ErrorMessage = SR.ConnectionServiceConnectErrorNullParams
};
}
if (!connectionParams.IsValid(out paramValidationErrorMessage))
if (!connectionParams.IsValid(out string paramValidationErrorMessage))
{
return new ConnectionCompleteParams
{
OwnerUri = connectionParams.OwnerUri,
Messages = paramValidationErrorMessage
ErrorMessage = paramValidationErrorMessage
};
}
@@ -569,6 +568,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
catch (Exception ex)
{
response.Messages = ex.ToString();
response.ErrorMessage = ex.Message;
}
return response;