View Javadoc

1   /* The contents of this file are subject to the license and copyright terms
2    * detailed in the license directory at the root of the source tree (also 
3    * available online at http://www.fedora.info/license/).
4    */
5   package org.fedoracommons.funapi;
6   
7   
8   /**
9    *
10   * @author Edwin Shin
11   * @since 0.1
12   * @version $Id: UnapiException.java 33 2008-10-25 19:31:36Z pangloss $
13   */
14  public class UnapiException
15          extends Exception {
16      
17      private static final long serialVersionUID = 1L;
18      
19      private int code;
20      
21      public UnapiException(int errorCode, String message, Throwable cause) {
22          super(message, cause);
23          code = errorCode;
24      }
25      
26      public UnapiException(int errorCode, String message) {
27          this(errorCode, message, null);
28      }
29  
30      public UnapiException(String message, Throwable cause) {
31          this(500, message, cause);
32      }
33      
34      public UnapiException(String message) {
35          this(message, null);
36      }
37      
38      public int getErrorCode() {
39          return code;
40      }
41  }