User 870ab5b546
26-07-2007 17:50:45
We are using the UpdateHandler.execute() method. When the molecule it is trying to put in the database is empty, it throws an UpdateHandlerException.
However, if I put in a catch statement to catch the UpdateHandlerException, when I try to compile, the Java compiler tells me that an UpdateHandlerException is not thrown in the body of the try:
I can catch the UpdateHandlerException with a general catch Exception, but Rafi suggested you might like to hear about this behavior.
Code: |
chemaxon.jchem.db.UpdateHandlerException: Empty structure at chemaxon.jchem.db.UpdateHandler.readMolecule(UpdateHandler.java:1089) at chemaxon.jchem.db.UpdateHandler.init(UpdateHandler.java:945) at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:2003) at com.prenhall.epoch.db.chem.MolTable.importMol(MolTable.java:146) |
However, if I put in a catch statement to catch the UpdateHandlerException, when I try to compile, the Java compiler tells me that an UpdateHandlerException is not thrown in the body of the try:
Code: |
javac -deprecation -Xlint:all -d /home/aceorg/aceorg/DEV-1.7/epoch-plugin/build -classpath /home/aceorg/aceorg/DEV-1.7/epoch-plugin/build:/home/aceorg/aceorg/jchem/lib/jchem.jar:/home/aceorg/tomcat5/common/lib/classes12.jar:/home/aceorg/tomcat5/common/lib/commons-dbcp-1.2.1.jar:/home/aceorg/tomcat5/common/lib/commons-pool-1.2.jar:/home/aceorg/aceorg/DEV-1.7/epoch-plugin/lib/mbt_1.1.2_bin.jar:/home/aceorg/aceorg/DEV-1.7/epoch-plugin/lib/LewisSketch.jar:/home/aceorg/aceorg/DEV-1.7/epoch-plugin/lib/gnu-regexp-1.1.4.jar:/home/aceorg/tomcat5/common/lib/servlet.jar MolTable.java MolTable.java:147: exception chemaxon.jchem.db.UpdateHandlerException is never thrown in body of corresponding try statement } catch (UpdateHandlerException e1) { ^ 1 error make: *** [/home/aceorg/aceorg/DEV-1.7/epoch-plugin/build/com/prenhall/epoch/db/chem/MolTable.class] Error 1 |
I can catch the UpdateHandlerException with a general catch Exception, but Rafi suggested you might like to hear about this behavior.