make fileparse errors easier to debug by dumping file parameter contents in debug...
authorjprocter <Jim Procter>
Fri, 13 Nov 2009 11:22:33 +0000 (11:22 +0000)
committerjprocter <Jim Procter>
Fri, 13 Nov 2009 11:22:33 +0000 (11:22 +0000)
src/jalview/bin/JalviewLite.java

index 7329a6f..f23cbde 100755 (executable)
@@ -672,6 +672,21 @@ public class JalviewLite extends Applet
       {
         dbgMsg("File load exception.");
         ex.printStackTrace();
+        if (debug) {
+          try {
+            FileParse fp = new FileParse(file, protocol);
+            String ln = null;
+            dbgMsg(">>>Dumping contents of '"+file+"' "+"("+protocol+")");
+            while ((ln=fp.nextLine())!=null) {
+              dbgMsg(ln);
+            }
+            dbgMsg(">>>Dump finished.");
+          } catch (Exception e)
+          {
+            System.err.println("Exception when trying to dump the content of the file parameter.");
+            e.printStackTrace();
+          }
+        }
       }
       if ((al != null) && (al.getHeight() > 0))
       {