You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2016/06/30 08:53:50 UTC

[03/44] directory-kerby git commit: Save the error code in KrbException.

Save the error code in KrbException.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/fff2aa12
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/fff2aa12
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/fff2aa12

Branch: refs/heads/gssapi
Commit: fff2aa120fa665d1ceb0e4042669a3799825861e
Parents: 1adbb86
Author: plusplusjiajia <ji...@intel.com>
Authored: Tue Apr 19 16:01:22 2016 +0800
Committer: plusplusjiajia <ji...@intel.com>
Committed: Tue Apr 19 16:01:22 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/kerby/kerberos/kerb/KrbException.java    | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/fff2aa12/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbException.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbException.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbException.java
index ee3fa8d..0755250 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbException.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbException.java
@@ -21,6 +21,7 @@ package org.apache.kerby.kerberos.kerb;
 
 public class KrbException extends Exception {
     private static final long serialVersionUID = 7305497872367599428L;
+    private KrbErrorCode errorCode;
 
     public KrbException(String message) {
         super(message);
@@ -32,13 +33,20 @@ public class KrbException extends Exception {
 
     public KrbException(KrbErrorCode errorCode) {
         super(errorCode.getMessage());
+        this.errorCode = errorCode;
     }
 
     public KrbException(KrbErrorCode errorCode, Throwable cause) {
         super(errorCode.getMessage(), cause);
+        this.errorCode = errorCode;
     }
 
     public KrbException(KrbErrorCode errorCode, String message) {
         super(message + " with error code: " + errorCode.name());
+        this.errorCode = errorCode;
+    }
+
+    public KrbErrorCode getKrbErrorCode() {
+        return errorCode;
     }
 }