Commits

Anonymous committed f1ef97b

XW-92: Better exception messages when DefaultActionInvocation is unable to instantiate the Action

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk/src@72e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 9b2ee47

Comments (0)

Files changed (1)

File java/com/opensymphony/xwork/DefaultActionInvocation.java

     }
 
     /**
- * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
- * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
- * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
- * the result params.
- * @return a Result instance
- * @throws Exception
- */
+    * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
+    * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
+    * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
+    * the result params.
+    * @return a Result instance
+    * @throws Exception
+    */
     public Result getResult() throws Exception {
         if (result != null) {
             Result returnResult = result;
         // load action
         try {
             action = (Action) proxy.getConfig().getClazz().newInstance();
+        } catch (InstantiationException e) {
+            throw new XworkException("Unable to intantiate Action!", e);
+        } catch (IllegalAccessException e) {
+            throw new XworkException("Illegal access to constructor, is it public?", e);
         } catch (Exception e) {
             String gripe = "";
 
             }
 
             gripe += (" -- " + e.getMessage());
-            throw new IllegalArgumentException(gripe);
+            throw new XworkException(gripe);
         }
     }
 
     }
 
     /**
- * Uses getResult to get the final Result and executes it
- */
+    * Uses getResult to get the final Result and executes it
+    */
     private void executeResult() throws Exception {
         Result aResult = getResult();