Print

Print


Commit in java/trunk/conditions/src/main/java/org/hps/conditions/svt on MAIN
SvtConditionsConverter.java+12-5974 -> 975
Catch and handle the exception that is thrown when a conditions record for SVT bad channels is not found.

java/trunk/conditions/src/main/java/org/hps/conditions/svt
SvtConditionsConverter.java 974 -> 975
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java	2014-09-09 20:36:06 UTC (rev 974)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java	2014-09-09 23:31:18 UTC (rev 975)
@@ -106,13 +106,20 @@
     	if(metaData != null){
     		tableName = metaData.getTableName();
     	} else { 
+    	}
     		tableName = SVT_BAD_CHANNELS; 
-    	}
+    	
         // Add bad channels.
-        SvtBadChannelCollection badChannels = manager.getCachedConditions(SvtBadChannelCollection.class, tableName).getCachedData();
-        for (SvtBadChannel badChannel : badChannels.getObjects()) {
-            SvtChannel channel = conditions.getChannelMap().findChannel(badChannel.getChannelId());
-            conditions.getChannelConstants(channel).setBadChannel(true);
+        // FIXME: This should be changed to catch a conditions record not found exception instead of 
+    	// 		  a runtime exception.
+    	try { 
+        	SvtBadChannelCollection badChannels = manager.getCachedConditions(SvtBadChannelCollection.class, tableName).getCachedData();
+        	for (SvtBadChannel badChannel : badChannels.getObjects()) {
+        		SvtChannel channel = conditions.getChannelMap().findChannel(badChannel.getChannelId());
+        		conditions.getChannelConstants(channel).setBadChannel(true);
+        	}
+        } catch(RuntimeException e){
+        	e.printStackTrace();
         }
 
         // Get the table name containing the SVT gains from the database
SVNspam 0.1