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 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)