JAL-4195 add exception handling for all image output ops - still need to refactor...
[jalview.git] / src / jalview / gui / Desktop.java
index 1fcc591..bfd700f 100644 (file)
@@ -121,6 +121,7 @@ import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
+import jalview.io.exceptions.ImageOutputException;
 import jalview.jbgui.GSplitFrame;
 import jalview.jbgui.GStructureViewer;
 import jalview.project.Jalview2XML;
@@ -3131,7 +3132,11 @@ public class Desktop extends jalview.jbgui.GDesktop
     String title = "View of desktop";
     ImageExporter exporter = new ImageExporter(writer, null, TYPE.EPS,
             title);
-    exporter.doExport(of, this, width, height, title);
+    try {
+      exporter.doExport(of, this, width, height, title);
+    } catch (ImageOutputException ioex) {
+      jalview.bin.Console.error("Unexpected error whilst writing Jalview desktop snapshot as EPS",ioex);
+    }
   }
 
   /**