[saga-rg] task error handling...
Andre Merzky
andre at merzky.net
Sat Nov 5 00:17:05 CST 2005
Hi again,
the task error handling is somewhat unclear in the spec. We
had soe discussions with the GridRPC folx at GGF about that,
and I had some earlier notes. So, here is what came out of
the discussions:
- a running task does NEVER throw an error during its run
- if a task meets an error condition, the error (or
exception) is to be stored (if possible)
- if an error is encountered by a task, the task state has
to be changed to Failed
- the throw () method causes the task to throw any error
which was previously encountered. In all states _but_
in the Failed state the call does nothing.
Example code looks like:
{
task.run ();
task.wait ();
if ( task.get_status = saga::task::Failed )
{
try {
task.throw ();
}
catch ( saga::exception e )
{
std::cerr << "Oops!\n";
}
}
}
Note that the 'if' check for the task state is not
required - for all other states the try would yield
nothing.
Does anybody see problems with that approach? Is it simple
enought? The get_error method still exists, and returns the
error string (basically the string from exception.what() ).
Cheers, Andre.
--
+-----------------------------------------------------------------+
| Andre Merzky | phon: +31 - 20 - 598 - 7759 |
| Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
| Dept. of Computer Science | mail: merzky at cs.vu.nl |
| De Boelelaan 1083a | www: http://www.merzky.net |
| 1081 HV Amsterdam, Netherlands | |
+-----------------------------------------------------------------+
More information about the saga-rg
mailing list