avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 23563 - avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl
Date Sun, 25 Jul 2004 19:32:34 GMT
Author: niclas
Date: Sun Jul 25 12:32:34 2004
New Revision: 23563

Modified:
   avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java
Log:
Better error reporting. Submitted by Stephen.

Modified: avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java
==============================================================================
--- avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java
(original)
+++ avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java
Sun Jul 25 12:32:34 2004
@@ -20,6 +20,8 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.Properties;
@@ -180,8 +182,8 @@
               MERLIN_DEBUG, Boolean.class, new Boolean( false ) ),
             new Parameter( 
               MERLIN_AUDIT, Boolean.class, new Boolean( false ) ),
-            new Parameter( 
-              MERLIN_PROXY, Boolean.class, new Boolean( true ) ),
+            new Parameter( 
+              MERLIN_PROXY, Boolean.class, new Boolean( true ) ),
             new Parameter( 
               MERLIN_SERVER, Boolean.class, new Boolean( true ) ),
             new Parameter( 
@@ -559,18 +561,18 @@
         if( null != value ) return value.booleanValue();
         return false;
     }
-
-   /**
-    * Return proxy policy. 
-    *
-    * @return the proxy policy
-    */
-    public boolean isProxyEnabled()
-    {
-        Boolean value = (Boolean) get( MERLIN_PROXY );
-        if( null != value ) return value.booleanValue();
-        return true;
-    }
+
+   /**
+    * Return proxy policy. 
+    *
+    * @return the proxy policy
+    */
+    public boolean isProxyEnabled()
+    {
+        Boolean value = (Boolean) get( MERLIN_PROXY );
+        if( null != value ) return value.booleanValue();
+        return true;
+    }
 
    /**
     * Return the autostart policy.  If TRUE (the default) the 
@@ -760,9 +762,19 @@
                 }
                 else
                 {
-                    final String error = 
-                      "Unable to resolve the block path [" + value + "].";
-                    throw new KernelRuntimeException( error, e );
+                    if( e instanceof MalformedURLException )
+                    {
+                        FileNotFoundException fnfe = new FileNotFoundException( value );
+                        final String error = 
+                          "Unable to resolve the block path [" + value + "].";
+                        throw new KernelRuntimeException( error, fnfe );
+                    }
+                    else
+                    {
+                        final String error = 
+                          "Unable to resolve the block path [" + value + "].";
+                        throw new KernelRuntimeException( error, e );
+                    }
                 }
             }
         }

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


Mime
View raw message