Browse Source

Handle multiple exceptions being raised during TaskManager's main task

pull/22/merge
RogueException 9 years ago
parent
commit
4fda36e617
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/Discord.Net/TaskManager.cs

+ 4
- 2
src/Discord.Net/TaskManager.cs View File

@@ -70,8 +70,10 @@ namespace Discord
else else
SignalStop(); 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 //Run the cleanup function within our lock
if (_stopAction != null) if (_stopAction != null)


Loading…
Cancel
Save