make fileparse errors easier to debug by dumping file parameter contents in debug...
[jalview.git] / src / jalview / bin / JalviewLite.java
index 5d2aa04..f23cbde 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -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))
       {