pass any warning messages to StdErr - also todo to allow caller to check for any...
[jalview.git] / src / jalview / io / FormatAdapter.java
index 25e2fea..2735fb3 100755 (executable)
@@ -63,6 +63,8 @@ public class FormatAdapter extends AppletFormatAdapter
 
   /**
    * Format a vector of sequences as a flat alignment file.
+   * TODO: allow caller to detect errors and warnings encountered when generating output
+   *
    * 
    * @param format
    *                Format string as givien in the AppletFormatAdaptor list
@@ -130,8 +132,12 @@ public class FormatAdapter extends AppletFormatAdapter
        */
 
       afile.setSeqs(seqs);
-
-      return afile.print();
+      String afileresp = afile.print();
+      if (afile.hasWarningMessage())
+      {
+        System.err.println("Warning raised when writing as "+format+" : "+afile.getWarningMessage());
+      }
+      return afileresp;
     } catch (Exception e)
     {
       System.err.println("Failed to write alignment as a '" + format