title: Catching sql error while running ant task using ij tool on derby
body: <p>This is my ant task</p>
  
  <pre><code>&lt;target name="reset-derby-db" depends="clean-derby-db"&gt;
      &lt;java fork="true" classname="org.apache.derby.tools.ij" classpathref="derbylibraries"&gt;
          &lt;sysproperty key="ij.connection.bwfla" value="jdbc:derby:${derby.db.dir};create=true"/&gt;
          &lt;arg value="${derby.sql.dir}/derby.sql"/&gt;
      &lt;/java&gt;
  &lt;/target&gt; 
  </code></pre>
  
  <p>While running SQL files there could be some errors. I want to catch those errors in ant script. </p>
  
  <p>Error looks like something like this </p>
  
  <p><code>ERROR 42X94: TYPE 'TEXT' does not exist.</code></p>
  
  <p>Errors are something strange and should be avoided, but just want to show user that there is an error, for this reason I want to catch the error and fail the ant task.</p>