Catch exceptions raised sending telemetry events (#182)

This commit is contained in:
Karl Burtram
2016-12-12 15:50:08 -08:00
committed by GitHub
parent 40c1434745
commit 5c2e6b74cf

View File

@@ -359,6 +359,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
} }
if (ServiceHost != null) if (ServiceHost != null)
{
try
{ {
// Send a telemetry notification for intellisense performance metrics // Send a telemetry notification for intellisense performance metrics
ServiceHost.SendEvent(TelemetryNotification.Type, new TelemetryParams() ServiceHost.SendEvent(TelemetryNotification.Type, new TelemetryParams()
@@ -374,6 +376,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
} }
}); });
} }
catch (Exception ex)
{
Logger.Write(LogLevel.Verbose, "Could not send Connection telemetry event " + ex.ToString());
}
}
// Close the connection // Close the connection
info.SqlConnection.Close(); info.SqlConnection.Close();