Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/24/09 14:35:35 (15 years ago)
Author:
kgrading
Message:

added proper exception handling (#601)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.JobBase/3.2/JobBase.cs

    r1530 r1655  
    3434    private Thread thread = null;
    3535    public event EventHandler JobStopped;
     36    public event EventHandler JobFailed;
    3637   
    3738    public long JobId { get; set; }   
     
    4243
    4344    abstract public void Run();
     45    private void SecureRun() {
     46      try {
     47        Run();
     48      }
     49      catch (Exception ex) {
     50        if (JobFailed != null)
     51          JobFailed(this, new EventArgs());
     52      }
     53    }
    4454
    4555    public void Start() {
    46       thread = new Thread(new ThreadStart(Run));
     56      thread = new Thread(new ThreadStart(Run));     
    4757      thread.Start();
    4858      Running = true;
Note: See TracChangeset for help on using the changeset viewer.