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 08:18:34 UTC
exceptions in PublicationTask
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),
and in which should i throw ExecutionException from .execute() method?
Is this Exception handled somwhere ?
--
qMax
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re[2]: exceptions in PublicationTask
Posted by qMax <qm...@mediasoft.ru>.
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
Re: exceptions in PublicationTask
Posted by Andreas Hartmann <an...@apache.org>.
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),
That should be used when the task could not be executed
because some conditions are not supplied (e.g., the workflow
state could not be advanced). Everything stays under control.
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 ?
An exception should be thrown when a non-predictable problem
occurs (e.g., an IO error).
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org