Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: error handl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3591 of 3876
Post > Topic >>

Re: error handling in ant

by "Chris ( Val )" <chrisval@[EMAIL PROTECTED] > Nov 14, 2007 at 02:32 AM

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
 




 2 Posts in Topic:
Re: error handling in ant
"Chris ( Val )"  2007-11-14 02:32:41 
Re: error handling in ant
"Vitvitskiy Vladimir  2007-11-14 14:04:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 0:35:13 CST 2008.