mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 17:23:48 -05:00
File Browser: Adding async task exception handling (#504)
* Replacing Dictionary with ConcurrentDictionary since values are accessed in async contexts * Adding new method to allow async tasks to be executed in the exception continuation * Adding unit tests for the aforementioned * Adding exception handling to async tasks in file browser service * Updating query execution async handling to use the async version * Removing unnecesary send result from continuewithonfaulted
This commit is contained in:
@@ -277,9 +277,12 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
public void Execute()
|
||||
{
|
||||
ExecutionTask = Task.Run(ExecuteInternal)
|
||||
.ContinueWithOnFaulted(t =>
|
||||
.ContinueWithOnFaulted(async t =>
|
||||
{
|
||||
QueryFailed?.Invoke(this, t.Exception).Wait();
|
||||
if (QueryFailed != null)
|
||||
{
|
||||
await QueryFailed(this, t.Exception);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user