mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
Fix tools service crash + improve server edition naming (#506)
* Fix https://github.com/Microsoft/vscode-mssql/issues/986 and add better server edition naming - Fixed a number of issues related to the binding queue, specifically the fact that it didn't capture exceptions that occurred on the binding thread. This caused the thread to crash the service. - The root cause of the error was when you get a connection error during init of the SmoMetadataProvider which threw an exception. Because of this no Binder was created, and the code would null ref later during processing - Added logic to handle null ref issue and other related code - Added a unit test for the new error handling path, and supported still returning some value in this case - Separately, have a fix for an issue where the edition is shown as "SQL Azure" for all Azure connections. Fixing to be "Azure SQL DB" for this case and handle when the database reports as DW or Stretch instead. This maps better to users concept of what the edition should be and avoids returning what is an outdated term. * Messed up the test - fixing this by returning the expected return object
This commit is contained in:
@@ -238,7 +238,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
string script = string.Empty;
|
||||
ScriptingObject scriptingObject = parameters.ScriptingObjects[0];
|
||||
try
|
||||
{
|
||||
{
|
||||
Server server = new Server(bindingContext.ServerConnection);
|
||||
server.DefaultTextMode = true;
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user