morgand 2003/01/26 02:12:45 Modified: jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/task JellyTask.java Log: converting ant taglib from Exception to JellyTagException Revision Changes Path 1.12 +17 -3 jakarta-commons-sandbox/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/task/JellyTask.java Index: JellyTask.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/task/JellyTask.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- JellyTask.java 12 Dec 2002 15:40:37 -0000 1.11 +++ JellyTask.java 26 Jan 2003 10:12:45 -0000 1.12 @@ -18,6 +18,7 @@ import org.apache.commons.jelly.Jelly; import org.apache.commons.jelly.JellyContext; +import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.parser.XMLParser; @@ -27,6 +28,8 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; +import org.xml.sax.SAXException; + /** * <p><code>JellyTask</code> is an Ant task which will * run a given Jelly script. @@ -170,11 +173,22 @@ /** * Compiles the script */ - protected Script compileScript() throws Exception { + protected Script compileScript() throws JellyException { XMLParser parser = new XMLParser(); - parser.setContext(getJellyContext()); - Script script = parser.parse(getUrl().toString()); + + Script script = null; + try { + parser.setContext(getJellyContext()); + script = parser.parse(getUrl().toString()); + } + catch (IOException e) { + throw new JellyException(e); + } + catch (SAXException e) { + throw new JellyException(e); + } script = script.compile(); + if (log.isDebugEnabled()) { log.debug("Compiled script: " + getUrl()); }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>