Handle multiple exceptions being raised during TaskManager's main task

This commit is contained in:
RogueException
2015-12-28 05:14:50 -04:00
parent 56bf0fa254
commit 4fda36e617

View File

@@ -70,8 +70,10 @@ namespace Discord
else
SignalStop();
//Wait for the other tasks;
await allTasks.ConfigureAwait(false);
//Wait for the other tasks, and signal their errors too just in case
try { await allTasks.ConfigureAwait(false); }
catch (AggregateException ex) { SignalError(ex.InnerExceptions.First()); }
catch (Exception ex) { SignalError(ex); }
//Run the cleanup function within our lock
if (_stopAction != null)