mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user