ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38807] - Add an errorproperty parameter to <sql> task, like the junit task's
Date Tue, 28 Feb 2006 13:47:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38807>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38807





------- Additional Comments From stevel@apache.org  2006-02-28 14:47 -------
I see what you want here andrew, but I'm not sure what we are going to do about
it. To an extent the error handling of ant is a bit, well, messy; we have
limited policy hard coded into the tasks themselves.

Take a look at the ant-contrib project on sf.net, in particular their try/catch
task. Then look at <macrodef> and see what it would take to actually implement
what you want in a macro. something like (

<macrodef name="mysql">
 <attribute name="errors"/>
 <attribute name="file" />
 <sequential>
<trycatch property="errormessage" >
  <try>
   <sql >
    <transaction file="@{file}" />
   </sql>
  </try>
  <catch>
   <echo level="verbose" >${errormessage}</echo>
   <property name="@{errors}" value="${errormessage}"/>
  </catch>
</trycatch>
</sequential>
</macrodef>

If you fill the <sql> bit in with your DB connection, you get a task you can use
like
 <mysql errorproperty="errs" file="drop-db.sql" />
 <mysql errorproperty="errs" file="create-db.sql" />
 <mysql errorproperty="errs" file="create-user.sql" />
 <mysql errorproperty="errs" file="populate-db.sql" />

-steve

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message