Handle multiple exceptions being raised during TaskManager's main task
This commit is contained in:
@@ -70,8 +70,10 @@ namespace Discord
|
|||||||
else
|
else
|
||||||
SignalStop();
|
SignalStop();
|
||||||
|
|
||||||
//Wait for the other tasks;
|
//Wait for the other tasks, and signal their errors too just in case
|
||||||
await allTasks.ConfigureAwait(false);
|
try { await allTasks.ConfigureAwait(false); }
|
||||||
|
catch (AggregateException ex) { SignalError(ex.InnerExceptions.First()); }
|
||||||
|
catch (Exception ex) { SignalError(ex); }
|
||||||
|
|
||||||
//Run the cleanup function within our lock
|
//Run the cleanup function within our lock
|
||||||
if (_stopAction != null)
|
if (_stopAction != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user