pass up the errormessage in the exception when a datasource is not readable.
authorjprocter <Jim Procter>
Thu, 11 Oct 2007 10:36:36 +0000 (10:36 +0000)
committerjprocter <Jim Procter>
Thu, 11 Oct 2007 10:36:36 +0000 (10:36 +0000)
src/jalview/io/FileParse.java

index f4f765c..9c05d5f 100755 (executable)
@@ -146,6 +146,11 @@ public class FileParse
           }
         }
       }
+      catch (Exception e)
+      {
+        errormessage = "CANNOT ACCESS DATA AT URL '"+fileStr+"' ("+e.getMessage()+")";
+        error=true;
+      }
     }
     else if (type.equals(AppletFormatAdapter.PASTE))
     {
@@ -168,6 +173,11 @@ public class FileParse
         error = true;
       }
     }
+    if (dataIn==null)
+    {
+      // pass up the reason why we have no source to read from
+      throw new IOException("Failed to read data from source:\n"+errormessage);
+    }
     error=false;
     dataIn.mark(READAHEAD_LIMIT);
   }