1 package net.obsearch.exception; 2 3 /* 4 OBSearch: a distributed similarity search engine 5 This project is to similarity search what 'bit-torrent' is to downloads. 6 Copyright (C) 2007 Arnoldo Jose Muller Molina 7 8 This program is free software: you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation, either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 /** 22 * OBException, the mother of all Exceptions in OBSearch. 23 * @author Arnoldo Jose Muller Molina 24 * @since 0.7 25 */ 26 public class OBException 27 extends Exception { 28 29 30 /** 31 * Constructor. 32 * @param msg 33 * A message for the user 34 */ 35 public OBException(final String msg) { 36 super(msg); 37 } 38 39 /** 40 * Constructor. 41 * @param msg 42 * A message for the user 43 * @param ex 44 * An exception for the user 45 */ 46 public OBException(final String msg, final Exception ex) { 47 super(msg, ex); 48 } 49 50 /** 51 * Default constructor. 52 */ 53 public OBException() { 54 super(); 55 } 56 57 /** 58 * Constructor. 59 * @param e 60 * An exception that will be wrapped. 61 */ 62 public OBException(Exception e) { 63 super(e); 64 } 65 66 /** 67 * @return A description for the user of the exception. 68 */ 69 /*public String toString() { 70 if (ex != null && str != null) { 71 return str + " " + ex.getMessage(); 72 } else if (ex != null) { 73 return ex.toString(); 74 } else if (str != null) { 75 return str; 76 } else { 77 return "N/A, Sing this Corrosion!"; 78 } 79 }*/ 80 }