diff options
Diffstat (limited to 'lib/Task.cc')
-rw-r--r-- | lib/Task.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Task.cc b/lib/Task.cc index 27d2a24..faaeaf3 100644 --- a/lib/Task.cc +++ b/lib/Task.cc @@ -12,7 +12,10 @@ int Task::Do() { int Task::Run() { cerr << "Running task '" << GetName() << "'...\n"; try { - while ((state = Do()) != TASK_DONE); + state = Do(); + } + catch (TaskSwitch) { + throw; } catch (GeneralException e) { cerr << "Task " << GetName() << " caused an unexpected exception: '" << e.GetMsg() << "', closing it.\n"; |