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
022
023/*
024 * BioException.java
025 *
026 * Coppied from AceError By Thomas Down <td2@sanger.ac.uk>
027 */
028
029package org.biojava.bio;
030
031/**
032 * A nestable biological error.
033 *
034
035 * Catch this whenever it, or one of it's sub-classes are thrown and you know
036 * what to do once you've got it. Note: in general, you should not be catching
037 * errors. However, there are cases where it is necisary e.g. for logging. You
038 * will nearly always want to either re-throw the Error, throw a new Error
039 * or exit the current thread.
040 *
041 * 
042 * Throw this when something has gone wrong and in general people should not be
043 * handeling it.
044 * @author Matthew Pocock
045 * @since 1.0
046 */
047public class BioError extends Error {
048  /**
049   * Create a new BioError with a message.
050   *
051   * @param message  the message
052   */
053  public BioError(String message) {
054          super(message);
055  }
056
057  /**
058   * Create a new BioError with a cause.
059   *
060   * @param ex  the Throwable that caused this BioError
061   */
062  public BioError(Throwable ex) {
063    super(ex);
064  }
065
066  /**
067   * Create a new BioError with a cause and a message.
068   *
069   * @param ex  the Throwable that caused this BioError
070   * @param message  the message
071   * @deprecated Use BioError(message, ex) instead.
072   */
073  public BioError(Throwable ex, String message) {
074    this(message, ex);
075  }
076
077  /**
078   * Create a new BioError with a cause and a message.
079   *
080   * @param message  the message
081   * @param ex  the Throwable that caused this BioError
082   */
083  public BioError(String message, Throwable ex) {
084    super(message, ex);
085  }
086  
087  /**
088   * Create a new BioError.
089   */
090  public BioError() {
091          super();
092  }
093}