cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source BlobSource.java
Date Fri, 13 Sep 2002 07:30:51 GMT
cziegeler    2002/09/13 00:30:51

  Modified:    src/java/org/apache/cocoon/components/elementprocessor/types
                        NumericConverter.java
               src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements
                        Cell.java BaseElementProcessor.java EPSheet.java
               src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSource.java BlobSource.java
               src/java/org/apache/cocoon/components/flow/javascript
                        ListInputStream.java
               src/java/org/apache/cocoon/servlet ParanoidClassLoader.java
               .        changes.xml
               src/java/org/apache/cocoon/serialization HTMLSerializer.java
               src/java/org/apache/cocoon/environment/commandline
                        AbstractCommandLineEnvironment.java
               src/java/org/apache/cocoon/generation PhpGenerator.java
               src/java/org/apache/cocoon/components/classloader
                        RepositoryClassLoader.java
               src/java/org/apache/cocoon/components/source/impl
                        SourceFactoryWrapper.java
               src/scratchpad/src/org/apache/cocoon/components/source
                        BlobSource.java
  Added:       src/java/org/apache/cocoon CascadingIOException.java
  Log:
  Add CascadingIOException to wrap other exceptions inside an IOException
  
  Revision  Changes    Path
  1.2       +6 -4      xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/NumericConverter.java
  
  Index: NumericConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/NumericConverter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NumericConverter.java	6 Mar 2002 16:58:06 -0000	1.1
  +++ NumericConverter.java	13 Sep 2002 07:30:49 -0000	1.2
  @@ -52,6 +52,8 @@
   
   package org.apache.cocoon.components.elementprocessor.types;
   
  +import org.apache.cocoon.CascadingIOException;
  +
   import java.io.IOException;
   
   /**
  @@ -153,8 +155,8 @@
           catch (NumberFormatException ignored)
           {
               result = new NumericResult(
  -                new IOException(
  -                    "\"" + input + "\" does not represent a double value"));
  +                new CascadingIOException(
  +                    "\"" + input + "\" does not represent a double value", ignored));
           }
           return result;
       }
  @@ -216,8 +218,8 @@
           catch (NumberFormatException ignored)
           {
               result = new NumericResult(
  -                new IOException(
  -                    "\"" + input + "\" does not represent an integer value"));
  +                new CascadingIOException(
  +                    "\"" + input + "\" does not represent an integer value", ignored));
           }
           return result;
       }
  
  
  
  1.4       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
  
  Index: Cell.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Cell.java	5 May 2002 17:57:13 -0000	1.3
  +++ Cell.java	13 Sep 2002 07:30:49 -0000	1.4
  @@ -54,6 +54,7 @@
   
   
   
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.poi.hssf.usermodel.HSSFCell;
   import org.apache.poi.hssf.usermodel.HSSFCellStyle;
   
  @@ -139,11 +140,11 @@
               }
               catch (NumberFormatException e)
               {
  -                throw new IOException("Invalid value for a numeric cell: "
  -                                      + content);
  +                throw new CascadingIOException("Invalid value for a numeric cell: "
  +                                      + content, e);
               } 
               catch (ParseException e) {
  -                throw new IOException("Invalid value for a numberic cell: " + content);
  +                throw new CascadingIOException("Invalid value for a numberic cell: " +
content, e);
               }
           }
           else if (_cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
  
  
  
  1.3       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/BaseElementProcessor.java
  
  Index: BaseElementProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/BaseElementProcessor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseElementProcessor.java	31 Jul 2002 13:13:22 -0000	1.2
  +++ BaseElementProcessor.java	13 Sep 2002 07:30:49 -0000	1.3
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
   
   import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.components.elementprocessor.*;
   import org.apache.cocoon.components.elementprocessor.types.*;
   import org.apache.cocoon.components.elementprocessor.impl.poi.POIFSElementProcessor;
  @@ -325,8 +326,8 @@
           }
           catch (ClassCastException ignored)
           {
  -            throw new IOException(
  -                "parent is not compatible with this serializer");
  +            throw new CascadingIOException(
  +                "parent is not compatible with this serializer", ignored);
           }
   
           // can't trust the guarantee -- an overriding implementation
  
  
  
  1.2       +2 -1      xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheet.java
  
  Index: EPSheet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EPSheet.java	6 Mar 2002 16:58:02 -0000	1.1
  +++ EPSheet.java	13 Sep 2002 07:30:49 -0000	1.2
  @@ -55,6 +55,7 @@
   
   
   import org.apache.cocoon.components.elementprocessor.types.Attribute;
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.components.elementprocessor.ElementProcessor;
   import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
   import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  @@ -150,7 +151,7 @@
           }
           catch (Exception e)
           {
  -            throw new IOException(e.getMessage());
  +            throw new CascadingIOException(e.getMessage(), e);
           }
       }
       
  
  
  
  1.21      +5 -6      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java
  
  Index: SlideSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- SlideSource.java	22 Aug 2002 13:43:47 -0000	1.20
  +++ SlideSource.java	13 Sep 2002 07:30:50 -0000	1.21
  @@ -67,7 +67,7 @@
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.thread.ThreadSafe;
  -
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.components.source.InspectableSource;
   import org.apache.cocoon.components.source.LockableSource;
  @@ -474,8 +474,7 @@
                       // Creating an object 
                       structure.create(slideToken, subject, config.getFilesPath()+uri);
                   } catch (SlideException se) {
  -                    this.logger.debug("Could not create source.", se);
  -                    throw new IOException(se.getMessage());
  +                    throw new CascadingIOException(se);
                   }
   
                   NodeRevisionDescriptor revisionDescriptor =
  @@ -536,12 +535,12 @@
                       }
   
                       this.logger.error("Could not create source", se);
  -                    throw new IOException(se.getMessage());
  +                    throw new CascadingIOException(se.getMessage(), se);
                   }
   
               } catch (Exception e) {
                   this.logger.error("Could not create source", e);
  -                throw new IOException(e.getMessage());
  +                throw new CascadingIOException(e.getMessage(), e);
               } finally {
      
                   try {
  
  
  
  1.2       +4 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSource.java
  
  Index: BlobSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BlobSource.java	9 Aug 2002 07:30:31 -0000	1.1
  +++ BlobSource.java	13 Sep 2002 07:30:50 -0000	1.2
  @@ -61,6 +61,7 @@
   import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.cocoon.CascadingIOException;
   
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  @@ -375,8 +376,8 @@
                       tmp.close();
                   } catch(Exception e) {
                       String msg = "Error closing the connection for " + BlobSource.this.systemId;
  -                    BlobSource.this.getLogger().error(msg, e);
  -                    throw new IOException(msg + " : " + e.getMessage());
  +                    BlobSource.this.getLogger().warn(msg, e);
  +                    throw new CascadingIOException(msg + " : " + e.getMessage(), e);
                   }
               }
           }
  
  
  
  1.4       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/ListInputStream.java
  
  Index: ListInputStream.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/ListInputStream.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListInputStream.java	30 Aug 2002 00:52:53 -0000	1.3
  +++ ListInputStream.java	13 Sep 2002 07:30:50 -0000	1.4
  @@ -52,6 +52,7 @@
   import java.util.Enumeration;
   import java.util.List;
   import org.apache.avalon.excalibur.collections.ArrayEnumeration;
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.Source;
   
  @@ -147,7 +148,7 @@
           ((Source)sourcesList.get(i)).getInputStream().close();
       }
       catch (ProcessingException ex) {
  -      throw new IOException(ex.toString());
  +      throw new CascadingIOException(ex);
       }
       finally {
         currentStream = null;
  @@ -180,7 +181,7 @@
             = ((Source)sourcesList.get(currentIndex)).getInputStream();
         }
         catch (ProcessingException ex) {
  -        throw new IOException(ex.toString());
  +        throw new CascadingIOException(ex.toString(), ex);
         }
       }
   
  
  
  
  1.6       +4 -2      xml-cocoon2/src/java/org/apache/cocoon/servlet/ParanoidClassLoader.java
  
  Index: ParanoidClassLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/servlet/ParanoidClassLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ParanoidClassLoader.java	20 Mar 2002 11:00:06 -0000	1.5
  +++ ParanoidClassLoader.java	13 Sep 2002 07:30:50 -0000	1.6
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.servlet;
   
  +import org.apache.cocoon.CascadingIOException;
  +
   import java.io.IOException;
   import java.io.File;
   import java.net.MalformedURLException;
  @@ -199,7 +201,7 @@
           try {
               this.addURL(file.getCanonicalFile().toURL());
           } catch (MalformedURLException mue) {
  -            throw new IOException("Could not add repository");
  +            throw new CascadingIOException("Could not add repository", mue);
           }
       }
   }
  
  
  
  1.247     +4 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.246
  retrieving revision 1.247
  diff -u -r1.246 -r1.247
  --- changes.xml	13 Sep 2002 06:46:29 -0000	1.246
  +++ changes.xml	13 Sep 2002 07:30:50 -0000	1.247
  @@ -41,6 +41,9 @@
   
    <release version="@version@" date="@date@">
     <action dev="CZ" type="add">
  +   Added CascadingIOException to wrap other exceptions when an IOException is thrown.
  +  </action>
  +  <action dev="CZ" type="add">
      Added configurable buffering of the output. This removes all the problems
      with error handler and already committed responses etc. A new pipeline
      parameter "outputBufferSize" controlls the behaviour.
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/CascadingIOException.java
  
  Index: CascadingIOException.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon;
  
  import java.io.IOException;
  import java.io.PrintStream;
  import java.io.PrintWriter;
  
  import org.apache.avalon.framework.CascadingThrowable;
  import org.xml.sax.SAXParseException;
  import javax.xml.transform.TransformerException;
  import javax.xml.transform.SourceLocator;
  
  /**
   * This is a wrapping IOException.
   * 
   * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
   * @version CVS $Id: Processor.java,v 1.10 2002/08/12 07:50:53 cziegeler Exp $
   */
  
  public class CascadingIOException 
  extends IOException 
  implements CascadingThrowable {
  
      /**
       * The Throwable that caused this exception to be thrown.
       */
      private final Throwable m_throwable;
  
  
      /**
       * Construct a new <code>ProcessingException</code> instance.
       */
      public CascadingIOException(String message) {
          this(message, null);
      }
      
      /**
       * Creates a new <code>ProcessingException</code> instance.
       *
       * @param ex an <code>Exception</code> value
       */
      public CascadingIOException(Exception ex) {
          this(ex.getMessage(), ex);
      }
      
      /**
       * Construct a new <code>ProcessingException</code> that references
       * a parent Exception.
       */
      public CascadingIOException(String message, Throwable t) {
          super( message );
          this.m_throwable = t;
      }
      
      /**
       * Retrieve root cause of the exception.
       *
       * @return the root cause
       */
      public final Throwable getCause()
      {
          return this.m_throwable;
      }
  
      public String toString() {
          StringBuffer s = new StringBuffer();
          s.append(super.toString());
          final Throwable t = getCause();
          if(t!=null) {
              s.append(": ");
              // be more verbose try to get location info
              s.append( extraInfo(t) );
              s.append(t.toString());
          }
          return s.toString();
      }
      
      /**
       * Examine Throwable and try to figure out location information.
       * <p>
       *   At the moment only SAXParseException, and TransformerException
       *   are considered.
       * </p>
       *
       * @return String containing location information of the format
       *  <code>{file-name}:{line}:{column}:</code>, if no location info is 
       *  available return empty string
       */
      private String extraInfo( Throwable t ) {
          StringBuffer sb = new StringBuffer();
          if (t instanceof SAXParseException) {
              SAXParseException spe = (SAXParseException)t;
              sb.append( String.valueOf(spe.getSystemId()));
              sb.append( ":" );
              sb.append( String.valueOf(spe.getLineNumber()));
              sb.append( ":" );
              sb.append( String.valueOf(spe.getColumnNumber()));
              sb.append( ":" );
          } else if (t instanceof TransformerException) {
              TransformerException transformerException = (TransformerException) t;
              SourceLocator sourceLocator = transformerException.getLocator();
              
              if( null != sourceLocator ) {
                  sb.append( String.valueOf(sourceLocator.getSystemId()));
                  sb.append( ":" );
                  sb.append( String.valueOf(sourceLocator.getLineNumber()));
                  sb.append( ":" );
                  sb.append( String.valueOf(sourceLocator.getColumnNumber()));
                  sb.append( ":" );
              }
          }
          return sb.toString();
      }
      
      public void printStackTrace() {
          super.printStackTrace();
          if(getCause()!=null)
              getCause().printStackTrace();
      }
      
      public void printStackTrace( PrintStream s ) {
          super.printStackTrace(s);
          if(getCause()!=null)
              getCause().printStackTrace(s);
      }
      
      public void printStackTrace( PrintWriter s ) {
          super.printStackTrace(s);
          if(getCause()!=null)
              getCause().printStackTrace(s);
      }
  
  }
  
  
  
  
  1.10      +4 -3      xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java
  
  Index: HTMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HTMLSerializer.java	23 Aug 2002 11:06:15 -0000	1.9
  +++ HTMLSerializer.java	13 Sep 2002 07:30:50 -0000	1.10
  @@ -55,6 +55,8 @@
   import javax.xml.transform.stream.StreamResult;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.cocoon.CascadingIOException;
  +
   import java.io.IOException;
   import java.io.OutputStream;
   
  @@ -94,8 +96,7 @@
               this.setContentHandler(handler);
               this.setLexicalHandler(handler);
           } catch (Exception e) {
  -            this.getLogger().error("HTMLSerializer.setOutputStream()", e);
  -            throw new IOException(e.toString());
  +            throw new CascadingIOException(e.toString(), e);
           }
       }
   
  
  
  
  1.12      +6 -5      xml-cocoon2/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
  
  Index: AbstractCommandLineEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractCommandLineEnvironment.java	12 Sep 2002 14:22:42 -0000	1.11
  +++ AbstractCommandLineEnvironment.java	13 Sep 2002 07:30:50 -0000	1.12
  @@ -52,6 +52,7 @@
   
   import org.apache.avalon.framework.logger.Logger;
   
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.AbstractEnvironment;
  @@ -134,11 +135,11 @@
                   redirectSource = this.resolveURI(newURL);
                   this.toSAX(redirectSource, ls);
               } catch (SourceException se) {
  -                throw new IOException("SourceException: " + se);
  +                throw new CascadingIOException("SourceException: " + se, se);
               } catch (SAXException se) {
  -                throw new IOException("SAXException: " + se);
  +                throw new CascadingIOException("SAXException: " + se, se);
               } catch (ProcessingException pe) {
  -                throw new IOException("ProcessingException: " + pe);
  +                throw new CascadingIOException("ProcessingException: " + pe, pe);
               } finally {
                   this.release( redirectSource );
               }
  @@ -154,7 +155,7 @@
                       this.outputStream.write(buffer, 0, length);
                   }
               } catch (SourceException se) {
  -                throw new IOException("SourceException: " + se);
  +                throw new CascadingIOException("SourceException: " + se, se);
               } finally {
                   this.release( redirectSource);
               }
  
  
  
  1.8       +2 -4      xml-cocoon2/src/java/org/apache/cocoon/generation/PhpGenerator.java
  
  Index: PhpGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/PhpGenerator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PhpGenerator.java	7 Jun 2002 13:15:09 -0000	1.7
  +++ PhpGenerator.java	13 Sep 2002 07:30:51 -0000	1.8
  @@ -193,11 +193,9 @@
               // clean up
               php.destroy();
           } catch (IOException e) {
  -            getLogger().debug("PhpGenerator.generate()", e);
               throw e;
           } catch (Exception e) {
  -            getLogger().debug("PhpGenerator.generate()", e);
  -            throw new IOException(e.toString());
  +            throw new ProcessingException(e.toString(), e);
           } finally {
               this.resolver.release( inputSource );
               this.manager.release(parser);
  
  
  
  1.8       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/classloader/RepositoryClassLoader.java
  
  Index: RepositoryClassLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/classloader/RepositoryClassLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RepositoryClassLoader.java	31 Jul 2002 13:13:21 -0000	1.7
  +++ RepositoryClassLoader.java	13 Sep 2002 07:30:51 -0000	1.8
  @@ -52,6 +52,7 @@
   
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.util.ClassUtils;
   
   import java.io.File;
  @@ -142,7 +143,7 @@
             this.addURL(repository.getCanonicalFile().toURL());
         } catch (MalformedURLException mue) {
             log.error("The repository had a bad URL", mue);
  -          throw new IOException("Could not add repository");
  +          throw new CascadingIOException("Could not add repository", mue);
         }
     }
   
  @@ -160,7 +161,7 @@
             this.addURL(file.getCanonicalFile().toURL());
         } catch (MalformedURLException mue) {
             log.error("The repository had a bad URL", mue);
  -          throw new IOException("Could not add repository");
  +          throw new CascadingIOException("Could not add repository", mue);
         }
     }
   
  
  
  
  1.5       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java
  
  Index: SourceFactoryWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SourceFactoryWrapper.java	12 Sep 2002 06:16:43 -0000	1.4
  +++ SourceFactoryWrapper.java	13 Sep 2002 07:30:51 -0000	1.5
  @@ -72,6 +72,7 @@
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.CocoonComponentManager;
   import org.apache.cocoon.environment.Environment;
  @@ -171,7 +172,7 @@
           try {
               source = this.sourceFactory.getSource(currentEnv, location);
           } catch (ProcessingException pe) {
  -            throw new IOException("ProcessingException: " + pe.getMessage());
  +            throw new CascadingIOException("ProcessingException: " + pe.getMessage(), pe);
           }
           return new CocoonToAvalonSource( source );
       }
  
  
  
  1.5       +4 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/BlobSource.java
  
  Index: BlobSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/BlobSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlobSource.java	2 Aug 2002 07:06:20 -0000	1.4
  +++ BlobSource.java	13 Sep 2002 07:30:51 -0000	1.5
  @@ -59,6 +59,7 @@
   
   import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   
  +import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.ProcessingException;
   
   import java.io.InputStream;
  @@ -284,8 +285,8 @@
                       tmp.close();
                   } catch(Exception e) {
                       String msg = "Error closing the connection for " + BlobSource.this.systemId;
  -                    BlobSource.this.getLogger().error(msg, e);
  -                    throw new IOException(msg + " : " + e.getMessage());
  +                    BlobSource.this.getLogger().warn(msg, e);
  +                    throw new CascadingIOException(msg + " : " + e.getMessage(), e);
                   }
               }
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message