mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Fix GUID parse error breaking some on-prem connections (#654)
* Fix GUID parse error breaking on-prem connections - Fixes https://github.com/Microsoft/sqlopsstudio/issues/1896 - Verified this is only used in retry logic on Azure, so the fact it's failing on-prem isn't relevant. It's still unclear why in some cases the session ID is non-null but not a GUID. * Added back logging if parse of the GUID fails
This commit is contained in:
@@ -434,12 +434,15 @@ SET NUMERIC_ROUNDABORT OFF;";
|
|||||||
if (DBNull.Value != result)
|
if (DBNull.Value != result)
|
||||||
{
|
{
|
||||||
string sessionId = (string)command.ExecuteScalar();
|
string sessionId = (string)command.ExecuteScalar();
|
||||||
_azureSessionId = new Guid(sessionId);
|
if (!Guid.TryParse(sessionId, out _azureSessionId))
|
||||||
|
{
|
||||||
|
Logger.Write(LogLevel.Error, Resources.UnableToRetrieveAzureSessionId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SqlException exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
Logger.Write(LogLevel.Error, Resources.UnableToRetrieveAzureSessionId + exception.ToString());
|
Logger.Write(LogLevel.Error, Resources.UnableToRetrieveAzureSessionId + exception.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user