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.Core/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Async/HeuristicLab.Core/3.3/Engine.cs

    r15065 r15232  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using System.Threading;
    2526using HeuristicLab.Common;
     
    9091      } catch (OperationCanceledException) {
    9192      } catch (AggregateException ae) {
    92         if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]);
    93         else OnExceptionOccurred(ae);
     93        OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);
    9494      } catch (Exception e) {
    9595        OnExceptionOccurred(e);
  • branches/Async/HeuristicLab.Core/3.3/Executable.cs

    r15065 r15232  
    9393    public virtual async Task StartAsync() { await StartAsync(CancellationToken.None); }
    9494    public virtual async Task StartAsync(CancellationToken cancellationToken) {
    95       await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);
     95      await AsyncHelper.DoAsync(Start, cancellationToken);
    9696    }
    9797    public virtual void Pause() {
Note: See TracChangeset for help on using the changeset viewer.