View Javadoc

1   package org.kit.furia.exceptions;
2   
3   /*
4    Furia-chan: An Open Source software license violation detector.    
5    Copyright (C) 2007 Kyushu Institute of Technology
6   
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10   (at your option) any later version.
11  
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16  
17   You should have received a copy of the GNU General Public License
18   along with this program.  If not, see <http://www.gnu.org/licenses/>.
19   */
20  
21  /**
22   * IRException is an exception wrapper. It holds exceptions thrown by the underlying Information Retrieval
23   * system implementation.
24   * @author Arnoldo Jose Muller Molina
25   * @since 0
26   */
27  public class IRException
28          extends Exception {
29      /**
30       * Internal exception
31       */
32      private Exception e;
33      private String msg;
34             
35      public IRException(String x){
36          msg = x;
37      }
38      
39      public IRException(Exception e){
40          this.e = e;
41      }
42      
43      public String toString(){
44          if(e != null){
45          return e.getMessage();
46          }else if(msg != null){
47              return msg;
48          }else{
49              return "N/A";
50          }
51      }
52  }