cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1061894 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Date Fri, 21 Jan 2011 16:43:22 GMT
Author: jbellis
Date: Fri Jan 21 16:43:21 2011
New Revision: 1061894

URL: http://svn.apache.org/viewvc?rev=1061894&view=rev
Log:
more robust error checking on getStorageConfigUrl
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1061894&r1=1061893&r2=1061894&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Fri Jan 21 16:43:21 2011
@@ -101,8 +101,9 @@ public class    DatabaseDescriptor
         try
         {
             url = new URL(configUrl);
+            url.openStream(); // catches well-formed but bogus URLs
         }
-        catch (MalformedURLException e)
+        catch (Exception e)
         {
             ClassLoader loader = DatabaseDescriptor.class.getClassLoader();
             url = loader.getResource(configUrl);
@@ -373,6 +374,7 @@ public class    DatabaseDescriptor
         }
         catch (UnknownHostException e)
         {
+            e.printStackTrace();
             logger.error("Fatal error: " + e.getMessage());
             System.err.println("Unable to start with unknown hosts configured.  Use IP addresses
instead of hostnames.");
             System.exit(2);



Mime
View raw message