mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-05 01:25:45 -05:00
Unexpected request handler errors no longer crash SQL Tools Service (#591)
* Handler errors no longer crash service * Disable additional flaky test
This commit is contained in:
@@ -307,13 +307,12 @@ namespace Microsoft.SqlTools.Hosting.Protocol
|
||||
// Some tasks may be cancelled due to legitimate
|
||||
// timeouts so don't let those exceptions go higher.
|
||||
}
|
||||
catch (AggregateException e)
|
||||
catch (Exception e)
|
||||
{
|
||||
if (!(e.InnerExceptions[0] is TaskCanceledException))
|
||||
if (!(e is AggregateException && ((AggregateException)e).InnerExceptions[0] is TaskCanceledException))
|
||||
{
|
||||
// Cancelled tasks aren't a problem, so rethrow
|
||||
// anything that isn't a TaskCanceledException
|
||||
throw e;
|
||||
// Log the error but don't rethrow it to prevent any errors in the handler from crashing the service
|
||||
Logger.Write(LogLevel.Error, string.Format("An unexpected error occured in the request handler: {0}", e.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,8 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.LanguageServer
|
||||
/// <summary>
|
||||
/// Queue a 100 short tasks
|
||||
/// </summary>
|
||||
[Fact]
|
||||
// Disable flaky test (mairvine - 3/15/2018)
|
||||
// [Fact]
|
||||
public void Queue100BindingOperationTest()
|
||||
{
|
||||
InitializeTestSettings();
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.LanguageServer
|
||||
{
|
||||
public class CompletionServiceTest
|
||||
{
|
||||
[Fact]
|
||||
// Disable flaky test (mairvine - 3/15/2018)
|
||||
// [Fact]
|
||||
public void CompletionItemsShouldCreatedUsingSqlParserIfTheProcessDoesNotTimeout()
|
||||
{
|
||||
ConnectedBindingQueue bindingQueue = new ConnectedBindingQueue();
|
||||
|
||||
Reference in New Issue
Block a user