On Nov 14, 5:47 pm, "Vitvitskiy Vladimir"
<vvitvits...@[EMAIL PROTECTED]
> wrote:
> "Owen Jacobson" <angrybald...@[EMAIL PROTECTED]
> wrote in message
>
> news:1194970367.222167.12600@[EMAIL PROTECTED]
>
>
>
>
>
> > On Nov 13, 5:28 am, Lew <l...@[EMAIL PROTECTED]
> wrote:
> >> Multiposted message unified.
>
> >> Vitvitskiy Vladimir wrote:
> >> > Hi all, doesanthave possibility to handle errors ?
> >> > To be clear, i try to use oracleantext to redeploy oc4j war/ear
> >> > application
> >> >Antwhen app is not deployed "redeploy" task throws me failure --> i
> >> > want
> >> > then deploy ...
> >> > How can i make it use this workflow ? Thanks
>
> > It Depends.
>
> > My first thought would be to avoid the failure entirely. Can you use
> > conditionals to detect whether something is already deployed (based
> > on, for example, the existence or non-existence of a file)? If so,
> > you can select 'redeploy' vs 'deploy' before trying either one, and
> > allow failures to act as they normally do.
>
> > Alternately, you might be able to write a custom task (if one doesn't
> > exist already, google is your friend) to handle the failure by setting
> > a property or evaluating another task. It's possible the task you're
> > using to redeploy your app has this already; check the docs for the
> > attributes and elements the tag sup****ts.
>
> that is why i am asking ! i don't have access to internet only to
> newsgroups. All that i found in docs - this is possibility to
> play with "onerrror" attribute in task, but not all task have it, no
more
> docs to get additional info. thanks- Hide quoted text -
If you can avoid the error in the first place (as suggested
by Owen), by setting some property and adding some conditional
checks thereafter, then that would be the ideal situation.
If that is not ideal or possible for your situation, Ant has
a <fail> tag available, allowing you to throw an exception.
If you install an external Ant tool such as: "Ant-contrib",
then you can use the <fail> tag in conjunction with <try>,
<catch> and <finally> tags, as provided by "Ant-contrib".
I have tested it, and it seems to work ok.
--
Chris


|