axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r503292 - in /webservices/axis/trunk/java/src/org/apache/axis: ConfigurationException.java configuration/DirProvider.java
Date Sat, 03 Feb 2007 19:36:59 GMT
Author: gawor
Date: Sat Feb  3 11:36:58 2007
New Revision: 503292

URL: http://svn.apache.org/viewvc?view=rev&rev=503292
Log:
specify nicer error message

Modified:
    webservices/axis/trunk/java/src/org/apache/axis/ConfigurationException.java
    webservices/axis/trunk/java/src/org/apache/axis/configuration/DirProvider.java

Modified: webservices/axis/trunk/java/src/org/apache/axis/ConfigurationException.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/ConfigurationException.java?view=diff&rev=503292&r1=503291&r2=503292
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/ConfigurationException.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/ConfigurationException.java Sat Feb  3
11:36:58 2007
@@ -70,6 +70,15 @@
     }
 
     /**
+     * Construct a ConfigurationException from an Exception.
+     * @param message custom error message
+     * @param exception original exception which was unexpected
+     */
+    public ConfigurationException(String message, Exception exception) {
+        this(message, exception, copyStackByDefault);
+    }
+
+    /**
      * Stringify, including stack trace.
      *
      * @return a <code>String</code> view of this object
@@ -89,9 +98,20 @@
      * @param exception original exception which was unexpected
      * @param copyStack set to true to copy the orginal exception's stack
      */
-    public ConfigurationException(Exception exception, final boolean copyStack) {
-        super(exception.toString()  + (copyStack ? "\n"
-           + JavaUtils.stackToString(exception) : "" ));
+    public ConfigurationException(Exception exception, boolean copyStack) {
+        this(null, exception, copyStack);
+    }
+
+    /**
+     * Construct a ConfigurationException from an Exception.
+     * @param message custom error message
+     * @param exception original exception which was unexpected
+     * @param copyStack set to true to copy the orginal exception's stack
+     */
+    public ConfigurationException(String message, Exception exception, final boolean copyStack)
{
+        super((message != null ? message + "\n" : "") + 
+              exception.toString() +
+              (copyStack ? "\n" + JavaUtils.stackToString(exception) : "" ));
         containedException = exception;
         if(copyStack) {
             stackTrace = JavaUtils.stackToString(this);

Modified: webservices/axis/trunk/java/src/org/apache/axis/configuration/DirProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/configuration/DirProvider.java?view=diff&rev=503292&r1=503291&r2=503292
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/configuration/DirProvider.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/configuration/DirProvider.java Sat Feb
 3 11:36:58 2007
@@ -116,7 +116,9 @@
             WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(in));
             doc.deploy(this.deployment);
         } catch (Exception e) {
-            throw new ConfigurationException(e);
+            String err = "Error processing configuration file: " 
+                + file.getAbsolutePath();
+            throw new ConfigurationException(err, e, false);
         } finally {
             if (in != null) {
                 try {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message