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

Location:
branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r15216 r15232  
    344344    public async Task StartAsync() { await StartAsync(CancellationToken.None); }
    345345    public async Task StartAsync(CancellationToken cancellationToken) {
    346       await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);
     346      await AsyncHelper.DoAsync(Start, cancellationToken);
    347347    }
    348348
  • branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs

    r15065 r15232  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Threading;
    2425using HeuristicLab.Common;
     
    7778      } catch (OperationCanceledException) {
    7879      } catch (AggregateException ae) {
    79         if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]);
    80         else OnExceptionOccurred(ae);
     80        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
    8181      } catch (Exception e) {
    8282        OnExceptionOccurred(e);
Note: See TracChangeset for help on using the changeset viewer.