Return-Path: Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 51481 invoked by uid 1014); 30 Jul 2000 23:06:11 -0000 Date: 30 Jul 2000 23:06:11 -0000 Message-ID: <20000730230611.51480.qmail@locus.apache.org> From: sboag@locus.apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/java/src/org/apache/xalan/transformer TransformerImpl.java sboag 00/07/30 16:06:11 Modified: java/src/org/apache/xalan/transformer TransformerImpl.java Log: Fixed error handling. Revision Changes Path 1.8 +33 -4 xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java Index: TransformerImpl.java =================================================================== RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TransformerImpl.java 2000/07/23 17:46:25 1.7 +++ TransformerImpl.java 2000/07/30 23:06:11 1.8 @@ -236,7 +236,10 @@ } catch (SAXException se) { - throw new TransformException(se); + if(se instanceof trax.TransformException) + throw (trax.TransformException)se; + else + throw new TransformException(se); } catch (ClassNotFoundException e1) { @@ -292,11 +295,25 @@ // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). reader.parse( xmlSource ); + + // This has to be done to catch exceptions thrown from + // the transform thread spawned by the STree handler. + Exception e = getExceptionThrown(); + if(null != e) + { + if(e instanceof trax.TransformException) + throw (trax.TransformException)e; + else + throw new trax.TransformException(e); + } } catch(SAXException se) { - se.printStackTrace(); - throw new TransformException(se); + // se.printStackTrace(); + if(se instanceof TransformException) + throw (TransformException)se; + else + throw new TransformException(se); } catch(IOException ioe) { @@ -527,7 +544,10 @@ } catch(SAXException se) { - throw new TransformException(se); + if(se instanceof trax.TransformException) + throw (trax.TransformException)se; + else + throw new TransformException(se); } } @@ -1618,6 +1638,13 @@ // Implement Runnable // //////////////////////// + private Exception m_exceptionThrown; + + public Exception getExceptionThrown() + { + return m_exceptionThrown; + } + /** * Run the transform thread. */ @@ -1629,6 +1656,8 @@ } catch(Exception e) { + // e.printStackTrace(); + m_exceptionThrown = e; ; // should have already been reported via the error handler? } }