Hi Bob,

'try / catch' doesn't seem to work in Jmol 14.4.3_2016.02.17 
(application and applet at
http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm) if it is used to check 
loading a text file using the 'load' function.

---- Example code ------------
function loadTest(fileName) {
   var fileData = [];
   while(true) {
      try {
        fileData = load(fileName);
      } catch(e) {
        print e;
        print "ERROR: could not load file '" + fileName + "'";
        return fileData;
      }
      print "NOTE: loaded file '" + fileName + "' succesfully";
      break;
   }
   return fileData;
}

x=loadTest("wrongFilename.txt");
print x;

--- Output from application -----------
NOTE: loaded file 'wrongFilename.txt' succesfully
java.io.FileNotFoundException: wrongFilename.txt (No such file or directory)

--- Output from applet  ---------------
NOTE: loaded file 'wrongFilename.txt' succesfully
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /jmol/jsmol/wrongFilename.txt was not found on this 
server.</p>
<hr>
<address>Apache Server at chemapps.stolaf.edu Port 80</address>
</body></html>
---------------------------------------

Regards,
Rolf

-- 

Rolf Huehne
Postdoc

Leibniz Institute on Aging - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  rolf.hue...@leibniz-fli.de
Website: http://www.leibniz-fli.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Burkhard Zinner

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to