sboag       00/10/06 00:54:47

  Modified:    java/src/org/apache/xalan/transformer TransformerImpl.java
  Log:
  Notify if parse fails.  Handle wrapped exceptions.
  
  Revision  Changes    Path
  1.27      +22 -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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- TransformerImpl.java      2000/10/05 01:38:37     1.26
  +++ TransformerImpl.java      2000/10/06 07:54:46     1.27
  @@ -305,7 +305,7 @@
                   
           // Set the reader for cloning purposes.
           getXPathContext().setPrimaryReader(reader);
  -        
  +        this.m_exceptionThrown = null;
           if(inputHandler instanceof org.apache.xalan.stree.SourceTreeHandler)
           {
             
((org.apache.xalan.stree.SourceTreeHandler)inputHandler).setInputSource(xmlSource);
  @@ -339,10 +339,17 @@
           {
             if(e instanceof trax.TransformException)
               throw (trax.TransformException)e;
  -          else
  +          else if(e instanceof 
org.apache.xalan.utils.WrappedRuntimeException)
  +            throw new trax.TransformException(
  +              
((org.apache.xalan.utils.WrappedRuntimeException)e).getException());
  +         else
               throw new trax.TransformException(e);
           }
         }
  +      catch(org.apache.xalan.utils.WrappedRuntimeException wre)
  +      {
  +        throw new TransformException(wre.getException());
  +      }
         catch(SAXException se)
         {
           // se.printStackTrace();
  @@ -1866,7 +1873,7 @@
     // Implement Runnable //  
     ////////////////////////
     
  -  private Exception m_exceptionThrown;
  +  private Exception m_exceptionThrown = null;
     
     public Exception getExceptionThrown()
     {
  @@ -1888,9 +1895,20 @@
       }
       catch(Exception e)
       {
  -      // e.printStackTrace();
         m_exceptionThrown = e;
         ; // should have already been reported via the error handler?
  +      synchronized (this)
  +      {
  +        String msg = e.getMessage();
  +        // System.out.println(e.getMessage());
  +        notifyAll();
  +        if(null == msg)
  +        {
  +          // m_throwNewError = false;
  +          e.printStackTrace();
  +        }
  +        // throw new org.apache.xalan.utils.WrappedRuntimeException(e);
  +      }
       }
     }
   
  
  
  

Reply via email to