Akka.Dispatch.ActorTaskScheduler.GetTaskException C# (CSharp) Method

GetTaskException() private static method

private static GetTaskException ( Task task ) : Exception
task Task
return System.Exception
        private static Exception GetTaskException(Task task)
        {
            switch (task.Status)
            {
                case TaskStatus.Canceled:
                    return new TaskCanceledException();

                case TaskStatus.Faulted:
                    return TryUnwrapAggregateException(task.Exception);
            }

            return null;
        }