001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021 022package org.biojava.bio; 023 024/** 025 * A nestable biological exception. 026 * 027 * 028 * 029 * 030 * Catch this whenever a method throws it, and you want to handle the exception. 031 * 032 * 033 * Throw this whenever you have caught a Throwable and need to throw an 034 * Exception or BioException in your method. 035 * 036 * 037 * Be sure to wrap up any causual throwable. It makes debugging your (and 038 * other peoples') code much easier. 039 * 040 * @since 1.0 041 * @author Matthew Pocock 042 */ 043public class BioException extends Exception { 044 /** 045 * Create a new BioException with a message. 046 * 047 * @param message the message 048 */ 049 public BioException(String message) { 050 super(message); 051 } 052 053 /** 054 * Create a new BioException with a cause. 055 * 056 * @param ex the Throwable that caused this BioException 057 */ 058 public BioException(Throwable ex) { 059 super(ex); 060 } 061 062 /** 063 * Create a new BioException with a cause and a message. 064 * 065 * @param ex the Throwable that caused this BioException 066 * @param message the message 067 * @deprecated use new BioException(message, ex) instead 068 */ 069 public BioException(Throwable ex, String message) { 070 this(message, ex); 071 } 072 073 /** 074 * Create a new BioException with a cause and a message. 075 * 076 * @param message the message 077 * @param ex the Throwable that caused this BioException 078 */ 079 public BioException(String message, Throwable ex) { 080 super(message, ex); 081 } 082 083 /** 084 * Create a new BioException. 085 */ 086 public BioException() { 087 super(); 088 } 089}