Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/18/17 12:18:47 (7 years ago)
Author:
jkarder
Message:

#2830:

  • the asynchronous calls are now awaited
  • added extension method to flatten and handle inner exceptions of AggregateExceptions
  • fixed some catch clauses
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Common/3.3/AsyncHelper.cs

    r15287 r15367  
    2121
    2222using System;
    23 using System.Linq;
    2423using System.Runtime.ExceptionServices;
    2524using System.Threading;
     
    3837      } catch (OperationCanceledException) {
    3938      } catch (AggregateException ae) {
    40         var e = ae.InnerExceptions.SingleOrDefault() ?? ae;
    41         ExceptionDispatchInfo.Capture(e).Throw();
     39        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => ExceptionDispatchInfo.Capture(e).Throw());
    4240      }
    4341    }
Note: See TracChangeset for help on using the changeset viewer.