Author: prabath
Date: Tue Feb 12 01:49:55 2008
New Revision: 13636

Log:

modified exception type

Modified:
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/DownloadInfoCardAction.java
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDDownloadInfoCardAction.java

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/DownloadInfoCardAction.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/DownloadInfoCardAction.java
       (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/DownloadInfoCardAction.java
       Tue Feb 12 01:49:55 2008
@@ -26,8 +26,10 @@
 
 import org.apache.struts2.StrutsStatics;
 import org.w3c.dom.Element;
+import org.wso2.solutions.identity.IdentityConstants;
 import org.wso2.solutions.identity.IdentityProviderException;
 import org.wso2.solutions.identity.cards.CardIssuer;
+import org.wso2.solutions.identity.relyingparty.RelyingPartyException;
 import org.wso2.solutions.identity.user.ui.UIConstants;
 
 import com.opensymphony.xwork2.ActionContext;
@@ -56,17 +58,17 @@
         response.setHeader("cache-control", "maxage=3");
         response.setHeader("Pragma", "public");
         Element card = null;
-        
+
         String details = null;
-        
+
         if (selfIssuedPpid != null) {
             card = cardIssuer.issueCardForSelfIssuedCard(selfIssuedPpid, true);
-         } else if (sessionPpid != null) {
+        } else if (sessionPpid != null) {
             card = cardIssuer.issueCardForSelfIssuedCard(sessionPpid, true);
         } else {
             card = cardIssuer.issueCardForUsername(userName, true);
         }
-    
+
         OutputStream out = response.getOutputStream();
         TransformerFactory.newInstance().newTransformer().transform(
                 new DOMSource(card), new StreamResult(out));
@@ -82,14 +84,19 @@
     public void setSelfIssuedPpid(String selfIssuedPpids) {
         this.selfIssuedPpid = selfIssuedPpids;
     }
-    
+
     /**
      * 
      * @return
-     * @throws IdentityProviderException
+     * @throws RelyingPartyException
      */
-    protected CardIssuer getCardIssuer() throws IdentityProviderException{
-        return new CardIssuer();
-}
+    protected CardIssuer getCardIssuer() throws RelyingPartyException {
+        try {
+            return new CardIssuer();
+        } catch (IdentityProviderException e) {
+            throw new RelyingPartyException(
+                    IdentityConstants.ErrorCodes.CARD_ISSUER_INIT_FAILURE);
+        }
+    }
 
 }

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDDownloadInfoCardAction.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDDownloadInfoCardAction.java
 (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDDownloadInfoCardAction.java
 Tue Feb 12 01:49:55 2008
@@ -1,7 +1,9 @@
 package org.wso2.solutions.identity.user.ui.action;
 
+import org.wso2.solutions.identity.IdentityConstants;
 import org.wso2.solutions.identity.IdentityProviderException;
 import org.wso2.solutions.identity.cards.CardIssuer;
+import org.wso2.solutions.identity.relyingparty.RelyingPartyException;
 
 public class OpenIDDownloadInfoCardAction extends DownloadInfoCardAction {
 
@@ -22,9 +24,15 @@
      * Overrides the base class method with the CardIssuer related to OpenID
      * Information card
      */
-    protected CardIssuer getCardIssuer() throws IdentityProviderException {
+    protected CardIssuer getCardIssuer() throws RelyingPartyException {
 
-        CardIssuer issuer = new CardIssuer();
+        CardIssuer issuer = null;
+        try {
+            issuer = new CardIssuer();
+        } catch (IdentityProviderException e) {
+            throw new RelyingPartyException(
+                    IdentityConstants.ErrorCodes.CARD_ISSUER_INIT_FAILURE);
+        }
 
         // We issue OpenIDInfoCards now - so our CardIssuer should support it.
         issuer.setIsOpenIdInfoCard(true);

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to