diff --git a/Aurora/Services/EventManager/EventManager.cs b/Aurora/Services/EventManager/EventManager.cs index cd5858a..8b41e43 100644 --- a/Aurora/Services/EventManager/EventManager.cs +++ b/Aurora/Services/EventManager/EventManager.cs @@ -182,7 +182,14 @@ namespace Aurora.Services.EventManager { actionsCopy.TryGetValue(pair.Key, out Action action); Task executionTask = new Task(() => action(bEvent)); - executionTask.ContinueWith((Task task) => ExceptionHandler(task, pair.Key), + + //Execute task with exception handler + executionTask.ContinueWith((Task task) => + { + var exception = executionTask.Exception; + Console.WriteLine(string.Format("SERVER --- Exception occurred firing event")); + this._actionList.Remove(pair.Key); + }, TaskContinuationOptions.OnlyOnFaulted); executionTask.Start(); @@ -192,13 +199,6 @@ namespace Aurora.Services.EventManager } - private void ExceptionHandler(Task executionTask, string actionKey) - { - var exception = executionTask.Exception; - Console.WriteLine(string.Format("SERVER --- Exception occurred firing event")); - this._actionList.Remove(actionKey); - } - #endregion Public Methods }