[Biojava-l] Exception handling

Richard HOLLAND hollandr at gis.a-star.edu.sg
Thu Dec 16 23:42:23 EST 2004


Hi all,

I'd like to be able to catch exceptions and handle them but it seems that many BioJava exceptions are sub-classes of the system kill everything no matter what exception, which makes them uncatchable. For instance if I try and load a junk sequence using DNATools, I get an exception quite rightly complaining about the alphabet, but even though I try-catch the code that parses this junk sequence (for Exception), the program quits completely without my exception handler or any further code being called.

Is this deliberate? Surely it would be nicer to allow these exceptions to be caught? I have noticed that many routines in the BioJava source code throw BioException (or a name similar to that, can't remember...), yet do not declare it in their method signatures. This could be why. It'd be much nicer to actually declare you are going to throw an exception, what type it is likely to be, then behave nicely instead of killing the whole app.

cheers,
Richard

Richard Holland
Bioinformatics Specialist
GIS extension 8199   
 
---------------------------------------------
This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its content to any other person. Thank you.
---------------------------------------------




More information about the Biojava-l mailing list