svn commit: rev 23563 - avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
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 );
+                    }
                 }
             }
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.