lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r788252 - /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
Date Thu, 25 Jun 2009 04:51:11 GMT
Author: noble
Date: Thu Jun 25 04:51:11 2009
New Revision: 788252

URL: http://svn.apache.org/viewvc?rev=788252&view=rev
Log:
SOLR-1245 DIH eats up SQL exception

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java?rev=788252&r1=788251&r2=788252&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
Thu Jun 25 04:51:11 2009
@@ -17,6 +17,8 @@
 package org.apache.solr.handler.dataimport;
 
 import org.apache.solr.common.SolrException;
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVERE;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -101,7 +103,7 @@
     final String driver = initProps.getProperty(DRIVER);
 
     if (url == null && jndiName == null)
-      throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
+      throw new DataImportHandlerException(SEVERE,
               "JDBC URL or JNDI name has to be specified");
 
     if (driver != null) {
@@ -146,7 +148,7 @@
                 c = dataSource.getConnection(user, pass);
               }
             } else {
-              throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
+              throw new DataImportHandlerException(SEVERE,
                       "the jndi name : '"+jndiName +"' is not a valid javax.sql.DataSource");
             }
           }
@@ -245,7 +247,7 @@
                 + (System.currentTimeMillis() - start));
         colNames = readFieldNames(resultSet.getMetaData());
       } catch (Exception e) {
-        throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
+        throw new DataImportHandlerException(SEVERE,
                 "Unable to execute query: " + query, e);
       }
       if (resultSet == null) {
@@ -332,6 +334,7 @@
       } catch (SQLException e) {
         logError("Error reading data ", e);
         close();
+        wrapAndThrow(SEVERE,e);
         return false;
       }
     }



Mime
View raw message