Author: adrianc
Date: Mon Apr 23 02:29:28 2012
New Revision: 1329032

URL: http://svn.apache.org/viewvc?rev=1329032&view=rev
Log:
Build out Mini-language exception handling.

Modified:
    ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java
    
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java

Modified: 
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java?rev=1329032&r1=1329031&r2=1329032&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java 
(original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Mon 
Apr 23 02:29:28 2012
@@ -466,17 +466,12 @@ public class SimpleMethod {
 
     /**
      * Execs the given operations returning true if all return true, or 
returning false and stopping if any return false.
+     * @throws MiniLangException 
      */
-    public static boolean runSubOps(List<MethodOperation> methodOperations, 
MethodContext methodContext) {
+    public static boolean runSubOps(List<MethodOperation> methodOperations, 
MethodContext methodContext) throws MiniLangException {
         for (MethodOperation methodOperation : methodOperations) {
-            try {
-                if (!methodOperation.exec(methodContext)) {
-                    return false;
-                }
-            } catch (Throwable t) {
-                String errMsg = "Error in simple-method operation [" + 
methodOperation.rawString() + "]: " + t.toString();
-                Debug.logError(t, errMsg, module);
-                throw new RuntimeException(errMsg);
+            if (!methodOperation.exec(methodContext)) {
+                return false;
             }
         }
         return true;

Modified: 
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java?rev=1329032&r1=1329031&r2=1329032&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java
 (original)
+++ 
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java
 Mon Apr 23 02:29:28 2012
@@ -54,7 +54,7 @@ public class ElseIf {
         return this.thenSubOps;
     }
 
-    public boolean runSubOps(MethodContext methodContext) {
+    public boolean runSubOps(MethodContext methodContext) throws 
MiniLangException {
         return SimpleMethod.runSubOps(thenSubOps, methodContext);
     }
 }


Reply via email to