Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/13/17 15:53:56 (7 years ago)
Author:
jkarder
Message:

#2258: worked on exception handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Async/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs

    r15065 r15232  
    312312      } catch (OperationCanceledException) {
    313313      } catch (AggregateException ae) {
    314         if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]);
    315         else OnExceptionOccurred(ae);
     314        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
    316315      } catch (Exception e) {
    317316        OnExceptionOccurred(e);
     
    324323    public async Task StartAsync() { await StartAsync(CancellationToken.None); }
    325324    public async Task StartAsync(CancellationToken cancellationToken) {
    326       await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);
     325      await AsyncHelper.DoAsync(Start, cancellationToken);
    327326    }
    328327
Note: See TracChangeset for help on using the changeset viewer.