catch OOM earlier * JAL-595
authorjprocter <Jim Procter>
Tue, 29 Jun 2010 09:42:46 +0000 (09:42 +0000)
committerjprocter <Jim Procter>
Tue, 29 Jun 2010 09:42:46 +0000 (09:42 +0000)
src/jalview/gui/SequenceFetcher.java

index 34f0e79..7b42a3d 100755 (executable)
@@ -416,7 +416,18 @@ public class SequenceFetcher extends JPanel implements Runnable
               }
 
             }
-            AlignmentI indres = proxy.getSequenceRecords(item);
+
+            AlignmentI indres = null;
+            try
+            {
+              indres = proxy.getSequenceRecords(item);
+            } catch (OutOfMemoryError oome)
+            {
+              new OOMWarning(
+                      "fetching " + item + " from "
+                              + database.getSelectedItem(),oome,
+                      this);
+            }
             if (indres != null)
             {
               if (aresult == null)
@@ -446,7 +457,18 @@ public class SequenceFetcher extends JPanel implements Runnable
             multiacc.append(proxy.getAccessionSeparator());
           }
         }
-        aresult = proxy.getSequenceRecords(multiacc.toString());
+        try
+        {
+          aresult = proxy.getSequenceRecords(multiacc.toString());
+        } catch (OutOfMemoryError oome)
+        {
+          new OOMWarning(
+                  "fetching " + multiacc + " from "
+                          + database.getSelectedItem(),oome,
+                  this);
+        }
+        
+        
       }
 
     } catch (Exception e)