added sub types for parameters (#340)

This commit is contained in:
Leila Lali
2017-05-10 09:39:49 -07:00
committed by GitHub
parent 7625c8d83d
commit 39f5279631
7 changed files with 209 additions and 178 deletions

View File

@@ -200,16 +200,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
private async Task<ConnectionCompleteParams> Connect(ConnectParams connectParams)
{
string connectionErrorMessage = string.Empty;
try
{
// open connection based on request details
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
connectionErrorMessage = result != null ? result.Messages : string.Empty;
if (result != null && !string.IsNullOrEmpty(result.ConnectionId))
{
return result;
}
else
{
Logger.Write(LogLevel.Warning, $"Connection Failed for OE. connection error: {connectionErrorMessage}");
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
return null;
}
@@ -217,6 +220,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
}
catch (Exception ex)
{
Logger.Write(LogLevel.Warning, $"Connection Failed for OE. connection error:{connectionErrorMessage} error: {ex.Message}");
// Send a connection failed error message in this case.
ConnectionCompleteParams result = new ConnectionCompleteParams()
{