Author: keith
Date: Wed Jan  9 01:25:46 2008
New Revision: 12026

Log:

Fixing exception thrown when authentication fails



Modified:
   
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java

Modified: 
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
==============================================================================
--- 
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
      (original)
+++ 
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
      Wed Jan  9 01:25:46 2008
@@ -301,10 +301,14 @@
                                     DataHandler dataHandler, AxisConfiguration 
axisConfiguration)
             throws AxisFault {
 
+        boolean authenticated = false;
         try {
-            MashupUtils.authenticateUser(username, password);
+            authenticated = MashupUtils.authenticateUser(username, password);
         } catch (UserManagerException e) {
-            throw AxisFault.makeFault(e);
+            throw new MashupFault(e);
+        }
+        if (!authenticated) {
+            throw new MashupFault("Cannot authenticate user. Username or 
password is incorrect");
         }
         URL repository = axisConfiguration.getRepository();
         if (repository != null) {
@@ -315,8 +319,8 @@
             // Checking whether a file with the same name exists
             File file = new File(scriptsFolder, fileName);
             if (file.exists()) {
-                throw new AxisFault(
-                        "A Service JavaScript file with the same name already 
exists in the remote Mashup Server.");
+                throw new MashupFault("A Service JavaScript file with the same 
name already " +
+                        "exists in the remote Mashup Server.");                
        
             }
             MashupArchiveManupulator archiveManupulator = new 
MashupArchiveManupulator();
             // Extract the uploaded mashup archive to the scripts folder.

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to