directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1052920 - /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java
Date Sun, 26 Dec 2010 17:40:48 GMT
Author: kayyagari
Date: Sun Dec 26 17:40:48 2010
New Revision: 1052920

URL: http://svn.apache.org/viewvc?rev=1052920&view=rev
Log:
o added a reference to KrbError to give more information about the exception

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java?rev=1052920&r1=1052919&r2=1052920&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/KerberosException.java
Sun Dec 26 17:40:48 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.kerberos.exceptions;
 
+import org.apache.directory.shared.kerberos.messages.KrbError;
+
 
 /**
  * The root of the Kerberos exception hierarchy.
@@ -29,6 +31,9 @@ public class KerberosException extends E
 {
     private static final long serialVersionUID = 2968072183596955597L;
 
+    /** the kerberos error */
+    private KrbError error;
+    
     /**
      * The Kerberos error code associated with this exception.
      */
@@ -53,7 +58,21 @@ public class KerberosException extends E
         this.errorCode = errorType.getValue();
     }
 
+    
+    /**
+     * 
+     * Creates a new instance of KerberosException.
+     *
+     * @param error the KrbError message
+     */
+    public KerberosException( KrbError error )
+    {
+        super( error.getMessageType().getMessage() );
+        this.errorCode = error.getErrorCode().getValue();
+        this.error = error;
+    }
 
+    
     /**
      * Creates a KerberosException with an {@link ErrorType} and an
      * underlying {@link Throwable} that caused this fault.
@@ -217,4 +236,15 @@ public class KerberosException extends E
         this.errorCode = errorCode;
         this.explanatoryData = explanatoryData;
     }
+
+
+    /**
+     * returns the KrbError message associated with this exception
+     * 
+     * @return the error, can be null
+     */
+    public KrbError getError()
+    {
+        return error;
+    }
 }



Mime
View raw message