You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by qMax <qm...@mediasoft.ru> on 2005/06/01 11:14:20 UTC

Re[2]: exceptions in PublicationTask

Wednesday, June 1, 2005, 2:18:32 PM, Andreas Hartmann wrote:

AH> qMax wrote:
>> I'm implementing PublishTree/DeactivateTree.
>> /*
>> public class Publish extends PublicationTask implements SiteTreeNodeVisitor;
>> public class PublishTree extends Publish;
>> */
>> the question occured:
>> in which cases i should just setResult(FAILURE),

AH> That should be used when the task could not be executed
AH> because some conditions are not supplied (e.g., the workflow
AH> state could not be advanced). Everything stays under control.

AH> BTW, I'm not quite sure if the result is evaluated at all.

>> and in which should i throw ExecutionException from .execute() method?
>> Is this Exception handled somwhere ?

AH> An exception should be thrown when a non-predictable problem
AH> occurs (e.g., an IO error).

The problem is that then i use node.acceptSubtree(SiteNodeVisitor) in
an Task.execute method, i can only catch DocumentException
either thrown or raised from visitNode()
and can not tell if an "failure" occur, or some critical exception raised...

-- 
 qMax


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org