cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml/dom DOMBuilder.java
Date Thu, 21 Nov 2002 18:18:49 GMT
sylvain     2002/11/21 10:18:49

  Modified:    src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
                        AuthenticationManager.java
               src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp
                        EsqlConnection.java EsqlHelper.java
               src/blocks/fop/java/org/apache/cocoon/serialization
                        FOPSerializer.java
               src/blocks/jfor/java/org/apache/cocoon/serialization
                        RTFSerializer.java
               src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components
                        PortalManager.java
               src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components
                        SessionManager.java
               src/java/org/apache/cocoon/components/language/markup/xsp
                        XSPRequestHelper.java XSPUtil.java
               src/java/org/apache/cocoon/components/language/programming/java
                        Javac.java
               src/java/org/apache/cocoon/components/sax
                        XMLByteStreamCompiler.java
               src/java/org/apache/cocoon/components/store
                        FilesystemStore.java
               src/java/org/apache/cocoon/components/validation/schematron
                        SchematronFactory.java
               src/java/org/apache/cocoon/environment/http HttpContext.java
                        HttpRequest.java
               src/java/org/apache/cocoon/generation
                        ImageDirectoryGenerator.java PhpGenerator.java
                        RequestGenerator.java
               src/java/org/apache/cocoon/samples/xmlform UserBean.java
               src/java/org/apache/cocoon/serialization TextSerializer.java
                        XMLSerializer.java
               src/java/org/apache/cocoon/xml/dom DOMBuilder.java
  Log:
  Changed all RuntimeExceptions that mask the original one to CascadingRuntimeExceptions.
  
  Revision  Changes    Path
  1.5       +2 -1      xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/AuthenticationManager.java
  
  Index: AuthenticationManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/AuthenticationManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AuthenticationManager.java	8 Oct 2002 14:43:20 -0000	1.4
  +++ AuthenticationManager.java	21 Nov 2002 18:18:48 -0000	1.5
  @@ -57,6 +57,7 @@
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceParameters;
   import org.apache.excalibur.source.SourceUtil;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -143,7 +144,7 @@
           try {
               SessionManager.addSessionContextProvider(contextProvider, AuthenticationConstants.SESSION_CONTEXT_NAME);
           } catch (ProcessingException local) {
  -            throw new RuntimeException("Unable to register provider for authentication
context.");
  +            throw new CascadingRuntimeException("Unable to register provider for authentication
context.", local);
           }
       }
   
  
  
  
  1.2       +4 -2      xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/EsqlConnection.java
  
  Index: EsqlConnection.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/EsqlConnection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EsqlConnection.java	18 Oct 2002 14:04:26 -0000	1.1
  +++ EsqlConnection.java	21 Nov 2002 18:18:48 -0000	1.2
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.components.language.markup.xsp;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
  +
   import java.sql.Connection;
   import java.util.Properties;
   import java.sql.SQLException;
  @@ -134,7 +136,7 @@
         try {
           jdbcSource = connection.getMetaData().getURL();
         } catch (Exception e) {
  -        throw new RuntimeException("Error accessing connection metadata: "+e);
  +        throw new CascadingRuntimeException("Error accessing connection metadata", e);
         }
         if (jdbcSource.startsWith("jdbc:postgresql:")) {
           limitMethod = LIMIT_METHOD_POSTGRESQL;
  
  
  
  1.4       +25 -15    xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/EsqlHelper.java
  
  Index: EsqlHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/EsqlHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EsqlHelper.java	17 Nov 2002 18:00:04 -0000	1.3
  +++ EsqlHelper.java	21 Nov 2002 18:18:48 -0000	1.4
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.components.language.markup.xsp;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
  +
   import java.io.BufferedInputStream;
   import java.io.BufferedReader;
   import java.io.Reader;
  @@ -80,7 +82,7 @@
           try {
               result = EsqlHelper.getBlob(set,set.findColumn(column));
           } catch (Exception e) {
  -            throw new RuntimeException("Error getting blob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting blob data for column " +
column, e);
           }
           return result;
       }
  @@ -109,7 +111,7 @@
                   return set.getString(column).getBytes();
               }
           } catch ( Exception e) {
  -            throw new RuntimeException("Error getting blob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting blob data for column " +
column, e);
           }
       }
   
  @@ -135,7 +137,7 @@
   		result = defaultString.getBytes();
   	    else result = null;
           } catch ( Exception e) {
  -            throw new RuntimeException("Error getting blob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting blob data for column " +
column, e);
           }
   	return result;
       }
  @@ -148,7 +150,7 @@
           try {
               result = EsqlHelper.getStringOrClob(set,set.findColumn(column), defaultString);
           } catch (Exception e) {
  -            throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting text from column " + column,
e);
           }
           return result;
       }
  @@ -183,7 +185,7 @@
   		    result = defaultString;
               }
           } catch ( Exception e) {
  -            throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting text from column " + column,
e);
           }
   	return result;
       }
  @@ -210,7 +212,7 @@
   		result = defaultString;
   	    else result = null;
           } catch ( Exception e) {
  -            throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting text from column " + column,
e);
           }
   	return result;
       }
  @@ -224,7 +226,7 @@
             try {
                 result = EsqlHelper.getAscii(set,set.findColumn(column),defaultString);
             } catch (Exception e) {
  -              throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +              throw new CascadingRuntimeException("Error getting ascii data for column
" + column, e);
             }
             return result;
         }
  @@ -256,10 +258,14 @@
   		    result = defaultString;
               }
           } catch (Exception e) {
  -            throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting ascii data from column "
+ column, e);
           } finally {
  -            if (asciiStream != null) try {asciiStream.close();} catch (Exception ase) {
  -                throw new RuntimeException("Error closing clob stream: " + ase.getMessage());
  +            if (asciiStream != null) {
  +                try {
  +                    asciiStream.close();
  +                } catch (Exception ase) {
  +                    throw new CascadingRuntimeException("Error closing clob stream", ase);
  +                }
               }
           }
           
  @@ -285,10 +291,14 @@
   		result = defaultString;
   	    else result = null;
           } catch (Exception e) {
  -            throw new RuntimeException("Error getting clob data: " + e.getMessage());
  +            throw new CascadingRuntimeException("Error getting ascii data for column "
+ column, e);
           } finally {
  -            if (asciiStream != null) try {asciiStream.close();} catch (Exception ase) {
  -                throw new RuntimeException("Error closing clob stream: " + ase.getMessage());
  +            if (asciiStream != null) {
  +                try {
  +                    asciiStream.close();
  +                } catch (Exception ase) {
  +                    throw new CascadingRuntimeException("Error closing clob stream", ase);
  +                }
               }
           }
           
  @@ -300,7 +310,7 @@
               try {
                   return new String(bytes,encoding);
               } catch (java.io.UnsupportedEncodingException uee) {
  -                throw new RuntimeException("Unsupported Encoding Exception: " + uee.getMessage());
  +                throw new CascadingRuntimeException("Unsupported Encoding Exception", uee);
               }
           }
           else {
  
  
  
  1.4       +3 -2      xml-cocoon2/src/blocks/fop/java/org/apache/cocoon/serialization/FOPSerializer.java
  
  Index: FOPSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/fop/java/org/apache/cocoon/serialization/FOPSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FOPSerializer.java	23 Sep 2002 03:30:44 -0000	1.3
  +++ FOPSerializer.java	21 Nov 2002 18:18:48 -0000	1.4
  @@ -53,6 +53,7 @@
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -258,7 +259,7 @@
                   if (getLogger().isWarnEnabled()) {
                       getLogger().warn("Cannot load  class " + this.rendererName, e);
                   }
  -                throw new RuntimeException("Cannot load class " + this.rendererName + "("
+ e + ")");
  +                throw new CascadingRuntimeException("Cannot load class " + this.rendererName,
e);
               }
           }
           this.driver.setRenderer(this.renderer);
  
  
  
  1.2       +4 -2      xml-cocoon2/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java
  
  Index: RTFSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RTFSerializer.java	25 Sep 2002 09:02:50 -0000	1.1
  +++ RTFSerializer.java	21 Nov 2002 18:18:48 -0000	1.2
  @@ -52,6 +52,8 @@
   
   import java.net.URL;
   import java.net.MalformedURLException;
  +
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -112,7 +114,7 @@
   
           } catch (Exception e) {
               getLogger().error("RTFSerializer.setOutputStream()", e);
  -            throw new RuntimeException(e.toString());
  +            throw new CascadingRuntimeException("RTFSerializer.setOutputStream()", e);
           }
       }
   
  
  
  
  1.4       +2 -1      xml-cocoon2/src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/PortalManager.java
  
  Index: PortalManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/PortalManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortalManager.java	8 Oct 2002 14:43:18 -0000	1.3
  +++ PortalManager.java	21 Nov 2002 18:18:48 -0000	1.4
  @@ -61,6 +61,7 @@
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceParameters;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -183,7 +184,7 @@
           try {
               SessionManager.addSessionContextProvider(provider, PortalConstants.SESSION_CONTEXT_NAME);
           } catch (ProcessingException local) {
  -            throw new RuntimeException("Unable to register provider for portal context.");
  +            throw new CascadingRuntimeException("Unable to register provider for portal
context.", local);
           }
       }
   
  
  
  
  1.3       +2 -1      xml-cocoon2/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components/SessionManager.java
  
  Index: SessionManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components/SessionManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SessionManager.java	8 Oct 2002 14:43:19 -0000	1.2
  +++ SessionManager.java	21 Nov 2002 18:18:48 -0000	1.3
  @@ -54,6 +54,7 @@
   import java.util.*;
   import java.util.jar.*;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -153,7 +154,7 @@
               SessionManager.addSessionContextProvider(provider, SessionConstants.REQUEST_CONTEXT);
               SessionManager.addSessionContextProvider(provider, SessionConstants.RESPONSE_CONTEXT);
           } catch (ProcessingException local) {
  -            throw new RuntimeException("Unable to register provider for standard contexts.");
  +            throw new CascadingRuntimeException("Unable to register provider for standard
contexts.", local);
           }
       }
   
  
  
  
  1.14      +6 -8      xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java
  
  Index: XSPRequestHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XSPRequestHelper.java	9 Aug 2002 08:29:43 -0000	1.13
  +++ XSPRequestHelper.java	21 Nov 2002 18:18:48 -0000	1.14
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.components.language.markup.xsp;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
  @@ -167,9 +168,8 @@
               try {
                   value = new String(value.getBytes(container_encoding), form_encoding);
               } catch(java.io.UnsupportedEncodingException uee) {
  -                throw new RuntimeException("Unsupported Encoding Exception: " +
  -                    uee.getMessage());
  -            }
  +                throw new CascadingRuntimeException("Unsupported Encoding Exception", uee);
  +           }
           }
   
           if (value == null) {
  @@ -283,8 +283,7 @@
                           values[i] = new String(values[i].getBytes(container_encoding),
                               form_encoding);
                       } catch(java.io.UnsupportedEncodingException uee) {
  -                        throw new RuntimeException("Unsupported Encoding Exception: " +
  -                            uee.getMessage());
  +                        throw new CascadingRuntimeException("Unsupported Encoding Exception",
uee);
                       }
                   }
                   XSPObjectHelper.elementData(URI, PREFIX, contentHandler,
  @@ -318,8 +317,7 @@
                           values[i] = new String(values[i].getBytes(container_encoding),
                               form_encoding);
                       } catch(java.io.UnsupportedEncodingException uee) {
  -                        throw new RuntimeException("Unsupported Encoding Exception: " +
  -                            uee.getMessage());
  +                        throw new CascadingRuntimeException("Unsupported Encoding Exception",
uee);
                       }
                   }
               }
  
  
  
  1.12      +13 -8     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java
  
  Index: XSPUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XSPUtil.java	15 Jul 2002 07:10:05 -0000	1.11
  +++ XSPUtil.java	21 Nov 2002 18:18:48 -0000	1.12
  @@ -64,10 +64,10 @@
   import org.xml.sax.SAXException;
   
   import org.apache.cocoon.environment.SourceResolver;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Component;
   import org.apache.excalibur.source.Source;
  -import java.lang.Long;
   
   import java.io.*;
   import java.net.URLDecoder;
  @@ -303,10 +303,15 @@
                   stream.close();
               }
           } catch (Exception e) {
  -            throw new RuntimeException(e.getMessage());
  +            throw new CascadingRuntimeException("Cannot get source " + uri, e);
           } finally {
  -            if ( stream != null )
  -                try {stream.close();} catch (Exception ase) {  throw new RuntimeException(ase.getMessage());
}
  +            if ( stream != null ) {
  +                try {
  +                    stream.close();
  +                } catch (Exception ase) {
  +                    throw new CascadingRuntimeException("Cannot close stream", ase);
  +                }
  +            }
               if ( resource != null )
                   resolver.release(resource);
           }
  @@ -323,7 +328,7 @@
               source = resolver.resolveURI(uri, base, null);
               resolver.toSAX(source, new org.apache.cocoon.xml.IncludeXMLConsumer(contentHandler));
             } catch (Exception e) {
  -              throw new RuntimeException("Error including source "+base+" "+uri+":"+e.getMessage());
  +              throw new CascadingRuntimeException("Error including source " + base + "
" + uri, e);
             } finally {
                 if (source != null)
                    resolver.release(source);
  @@ -343,7 +348,7 @@
               XSPUtil.includeInputSource(new InputSource(new FileReader(XSPUtil.relativeFilename(name,objectModel))),

                                          manager, contentHandler);
           } catch (IOException e) {
  -            throw new RuntimeException("Could not include file "+name+" : " + e.getMessage());
  +            throw new CascadingRuntimeException("Could not include file " + name, e);
           }
       }   
   
  @@ -356,7 +361,7 @@
               newParser = (Parser) manager.lookup(Parser.ROLE);
               XSPUtil.include(source, contentHandler, newParser);
           } catch (Exception e) {
  -            throw new RuntimeException("Could not include page " + e.getMessage());
  +            throw new CascadingRuntimeException("Could not include page", e);
           } finally {
               if (newParser != null) manager.release((Component) newParser);
           }
  
  
  
  1.8       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/java/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/java/Javac.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Javac.java	25 Jul 2002 14:07:52 -0000	1.7
  +++ Javac.java	21 Nov 2002 18:18:49 -0000	1.8
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.components.language.programming.java;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.components.language.programming.CompilerError;
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.log.Hierarchy;
  @@ -88,7 +89,7 @@
               modern = false;
           } catch (Exception ex) {
               Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon").error("No compiler found
in your classpath. Make sure you added 'tools.jar'", ex);
  -            throw new RuntimeException("No compiler found in your classpath. Make sure
you added 'tools.jar'");
  +            throw new CascadingRuntimeException("No compiler found in your classpath. Make
sure you added 'tools.jar'", ex);
           }
       }
     }
  
  
  
  1.8       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java
  
  Index: XMLByteStreamCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLByteStreamCompiler.java	26 Aug 2002 11:13:47 -0000	1.7
  +++ XMLByteStreamCompiler.java	21 Nov 2002 18:18:49 -0000	1.8
  @@ -51,6 +51,7 @@
   package org.apache.cocoon.components.sax;
   
   import org.apache.avalon.excalibur.pool.Recyclable;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.Component;
   import org.xml.sax.Attributes;
   import org.xml.sax.Locator;
  @@ -200,7 +201,7 @@
               this.write(locator.getLineNumber());
               this.write(locator.getColumnNumber());
           } catch (Exception e) {
  -             throw new RuntimeException(e.toString());
  +             throw new CascadingRuntimeException("Error while handling locator", e);
           }
       }
   
  
  
  
  1.21      +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/store/FilesystemStore.java
  
  Index: FilesystemStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/FilesystemStore.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- FilesystemStore.java	12 Sep 2002 11:27:37 -0000	1.20
  +++ FilesystemStore.java	21 Nov 2002 18:18:49 -0000	1.21
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.components.store;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  @@ -378,7 +379,7 @@
           try {
               return java.net.URLDecoder.decode( filename );
           } catch (Exception local) {
  -            throw new RuntimeException("Exception in decode: " + local);
  +            throw new CascadingRuntimeException("Exception in decode", local);
           }
       }
   
  
  
  
  1.8       +5 -4      xml-cocoon2/src/java/org/apache/cocoon/components/validation/schematron/SchematronFactory.java
  
  Index: SchematronFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/validation/schematron/SchematronFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SchematronFactory.java	25 Jun 2002 13:35:07 -0000	1.7
  +++ SchematronFactory.java	21 Nov 2002 18:18:49 -0000	1.8
  @@ -88,6 +88,7 @@
   import org.apache.commons.jxpath.JXPathContext;
   
   // Cocoon classes
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.components.validation.SchemaFactory;
   import org.apache.cocoon.components.validation.Schema;
   
  @@ -154,7 +155,7 @@
   
       } catch (Exception e) {
           logger.error("!!! Failed loading Schematron schema", e);
  -        throw new RuntimeException(" !!! Failed loading Schematron schema: \n" + e);
  +        throw new CascadingRuntimeException(" !!! Failed loading Schematron schema", e);
       }
      return schema;
     } // build
  
  
  
  1.8       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpContext.java
  
  Index: HttpContext.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpContext.java	22 Feb 2002 07:03:50 -0000	1.7
  +++ HttpContext.java	21 Nov 2002 18:18:49 -0000	1.8
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.environment.http;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.environment.Context;
   
   import javax.servlet.ServletContext;
  @@ -110,7 +111,7 @@
                   try {
                   value = this.servletContext.getResource("/WEB-INF").toString();
                   } catch (MalformedURLException mue) {
  -                    throw new RuntimeException("Cannot determine the base URL");
  +                    throw new CascadingRuntimeException("Cannot determine the base URL
for " + path, mue);
                   }
                   value = value.substring(0,value.length()-"WEB-INF".length());
               }
  
  
  
  1.11      +3 -3      xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HttpRequest.java	14 Nov 2002 18:01:01 -0000	1.10
  +++ HttpRequest.java	21 Nov 2002 18:18:49 -0000	1.11
  @@ -53,6 +53,7 @@
   import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.components.request.RequestFactory;
   
   import javax.servlet.RequestDispatcher;
  @@ -304,8 +305,7 @@
               byte[] bytes = str.getBytes(this.container_encoding);
               return new String(bytes, form_encoding);
           } catch (java.io.UnsupportedEncodingException uee) {
  -            throw new RuntimeException("Unsupported Encoding Exception: " +
  -            uee.getMessage());
  +            throw new CascadingRuntimeException("Unsupported Encoding Exception", uee);
           }
       }
   
  
  
  
  1.6       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/generation/ImageDirectoryGenerator.java
  
  Index: ImageDirectoryGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ImageDirectoryGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ImageDirectoryGenerator.java	6 Sep 2002 14:25:45 -0000	1.5
  +++ ImageDirectoryGenerator.java	21 Nov 2002 18:18:49 -0000	1.6
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.log.Hierarchy;
   import org.xml.sax.SAXException;
   
  @@ -98,7 +99,7 @@
               if(type.equals("gif")) return getGifSize(file);
               else return getJpegSize(file);
           } catch(Exception e) {
  -            throw new RuntimeException("File is not a valid GIF or Jpeg");
  +            throw new CascadingRuntimeException("File is not a valid GIF or Jpeg", e);
           }
   
       }
  
  
  
  1.9       +3 -2      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PhpGenerator.java	13 Sep 2002 07:30:51 -0000	1.8
  +++ PhpGenerator.java	21 Nov 2002 18:18:49 -0000	1.9
  @@ -51,6 +51,7 @@
   package org.apache.cocoon.generation;
   
   import org.apache.avalon.excalibur.xml.Parser;
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.http.HttpEnvironment;
   import org.apache.excalibur.source.Source;
  @@ -125,7 +126,7 @@
                   output.write(data.getBytes());
               } catch (IOException e) {
                   PhpGenerator.this.getLogger().debug("PhpGenerator.write()", e);
  -                throw new RuntimeException(e.getMessage());
  +                throw new CascadingRuntimeException("PhpGenerator.write()", e);
               }
           }
   
  
  
  
  1.9       +3 -3      xml-cocoon2/src/java/org/apache/cocoon/generation/RequestGenerator.java
  
  Index: RequestGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/RequestGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RequestGenerator.java	7 Aug 2002 13:15:01 -0000	1.8
  +++ RequestGenerator.java	21 Nov 2002 18:18:49 -0000	1.9
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.parameters.ParameterException;
  @@ -170,8 +171,7 @@
                           this.data(new String(values[x].getBytes(container_encoding),
                               form_encoding));
                       } catch(java.io.UnsupportedEncodingException uee) {
  -                        throw new RuntimeException("Unsupported Encoding Exception: " +
  -                            uee.getMessage());
  +                        throw new CascadingRuntimeException("Unsupported Encoding Exception",
uee);
                       }
                   } else {
                       this.data(values[x]);
  
  
  
  1.6       +2 -1      xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/UserBean.java
  
  Index: UserBean.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/UserBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- UserBean.java	27 Oct 2002 07:20:49 -0000	1.5
  +++ UserBean.java	21 Nov 2002 18:18:49 -0000	1.6
  @@ -7,6 +7,7 @@
   import java.util.List;
   import java.util.ArrayList;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.w3c.dom.*;
   import javax.xml.parsers.*;
   import javax.xml.transform.*;
  @@ -157,7 +158,7 @@
       }
       catch (Exception ex)
       {
  -      throw new RuntimeException("Failed to initialize DOM factory. Root cause: \n" + ex);
  +      throw new CascadingRuntimeException("Failed to initialize DOM factory.", ex);
       }
   
       // initialize system as dom node
  
  
  
  1.7       +4 -2      xml-cocoon2/src/java/org/apache/cocoon/serialization/TextSerializer.java
  
  Index: TextSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/TextSerializer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TextSerializer.java	1 Jul 2002 14:43:17 -0000	1.6
  +++ TextSerializer.java	21 Nov 2002 18:18:49 -0000	1.7
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.serialization;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
  +
   import javax.xml.transform.OutputKeys;
   import javax.xml.transform.sax.TransformerHandler;
   import javax.xml.transform.stream.StreamResult;
  @@ -78,7 +80,7 @@
               this.setLexicalHandler(handler);
          } catch (Exception e) {
               getLogger().error("TextSerializer.setOutputStream()", e);
  -            throw new RuntimeException(e.toString());
  +            throw new CascadingRuntimeException("TextSerializer.setOutputStream()", e);
           }
       }
   
  
  
  
  1.7       +4 -2      xml-cocoon2/src/java/org/apache/cocoon/serialization/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/XMLSerializer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLSerializer.java	1 Jul 2002 14:43:17 -0000	1.6
  +++ XMLSerializer.java	21 Nov 2002 18:18:49 -0000	1.7
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.serialization;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
  +
   import javax.xml.transform.OutputKeys;
   import javax.xml.transform.sax.TransformerHandler;
   import javax.xml.transform.stream.StreamResult;
  @@ -78,7 +80,7 @@
               this.setLexicalHandler(handler);
           } catch (Exception e) {
               getLogger().error("XMLSerializer.setOutputStream()", e);
  -            throw new RuntimeException(e.toString());
  +            throw new CascadingRuntimeException("XMLSerializer.setOutputStream()", e);
           }
       }
   
  
  
  
  1.8       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DOMBuilder.java	10 Mar 2002 02:15:02 -0000	1.7
  +++ DOMBuilder.java	21 Nov 2002 18:18:49 -0000	1.8
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.xml.dom;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.cocoon.xml.AbstractXMLPipe;
   import org.xml.sax.SAXException;
   import org.w3c.dom.Document;
  @@ -136,7 +137,7 @@
               }
               handler.setResult(this.result);
           } catch (javax.xml.transform.TransformerException local) {
  -            throw new RuntimeException("Fatal-Error: Unable to get transformer handler");
  +            throw new CascadingRuntimeException("Fatal-Error: Unable to get transformer
handler", local);
           }
       }
   
  @@ -167,7 +168,7 @@
               }
               handler.setResult(this.result);
           } catch (javax.xml.transform.TransformerException local) {
  -            throw new RuntimeException("Fatal-Error: Unable to get transformer handler");
  +            throw new CascadingRuntimeException("Fatal-Error: Unable to get transformer
handler", local);
           }
       }
   
  
  
  

----------------------------------------------------------------------
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