mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 01:25:42 -05:00
Send a Object Explorer session disconnect message on socket exceptions (#739)
* WIP * WIP 2 * Send disconnect message o binding exception * Add a try catch around the binding queue error handler
This commit is contained in:
@@ -88,9 +88,8 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
/// Generate a unique key based on the ConnectionInfo object
|
||||
/// </summary>
|
||||
/// <param name="connInfo"></param>
|
||||
private string GetConnectionContextKey(ConnectionInfo connInfo)
|
||||
{
|
||||
ConnectionDetails details = connInfo.ConnectionDetails;
|
||||
internal static string GetConnectionContextKey(ConnectionDetails details)
|
||||
{
|
||||
string key = string.Format("{0}_{1}_{2}_{3}",
|
||||
details.ServerName ?? "NULL",
|
||||
details.DatabaseName ?? "NULL",
|
||||
@@ -108,7 +107,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
key += "_" + details.GroupId;
|
||||
}
|
||||
|
||||
return key;
|
||||
return Uri.EscapeUriString(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -158,7 +157,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
|
||||
public void RemoveBindigContext(ConnectionInfo connInfo)
|
||||
{
|
||||
string connectionKey = GetConnectionContextKey(connInfo);
|
||||
string connectionKey = GetConnectionContextKey(connInfo.ConnectionDetails);
|
||||
if (BindingContextExists(connectionKey))
|
||||
{
|
||||
RemoveBindingContext(connectionKey);
|
||||
@@ -178,7 +177,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
}
|
||||
|
||||
// lookup the current binding context
|
||||
string connectionKey = GetConnectionContextKey(connInfo);
|
||||
string connectionKey = GetConnectionContextKey(connInfo.ConnectionDetails);
|
||||
if (BindingContextExists(connectionKey))
|
||||
{
|
||||
if (overwrite)
|
||||
|
||||
Reference in New Issue
Block a user