You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/07/25 21:32:34 UTC
svn commit: rev 23563 - avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl
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