Author: mes
Date: 2010-10-28 12:04:27 -0700 (Thu, 28 Oct 2010)
New Revision: 22552

Modified:
   
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
Log:
now properly catching exceptions validating tunables and getting the 
taskIterator

Modified: 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
===================================================================
--- 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
    2010-10-28 18:42:47 UTC (rev 22551)
+++ 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
    2010-10-28 19:04:27 UTC (rev 22552)
@@ -125,10 +125,23 @@
 
        @Override
        public void execute(final TaskFactory factory) {
-               if (tunableInterceptor.hasTunables(factory) && 
!tunableInterceptor.validateAndWriteBackTunables(factory))
+               TaskIterator tryTaskIterator;
+
+               try {
+                       if (tunableInterceptor.hasTunables(factory) && 
+                           
!tunableInterceptor.validateAndWriteBackTunables(factory))
+                               throw new IllegalArgumentException("Tunables 
are not valid");
+
+                       tryTaskIterator = factory.getTaskIterator();
+               } catch (Exception exception) {
+                       tryTaskIterator = null;
+                       logger.warn("Caught exception getting and validating 
task. ", exception);       
+                       new SwingTaskMonitor(cancelExecutorService, 
owner).showException(exception);
                        return;
+               }
 
-               final TaskIterator taskIterator = factory.getTaskIterator();
+               final TaskIterator taskIterator = tryTaskIterator;
+
                taskMonitor = null;
                final Runnable executor = new Runnable() {
                        public void run() {

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to