You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2009/07/01 05:13:25 UTC

Re: svn commit: r790027 - /ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java

doogie@apache.org wrote:
> Author: doogie
> Date: Wed Jul  1 02:54:01 2009
> New Revision: 790027
> 
> URL: http://svn.apache.org/viewvc?rev=790027&view=rev
> Log:
> Set the line number on the wrapped operation instance.
> 
> Modified:
>     ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.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=790027&r1=790026&r2=790027&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java (original)
> +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Wed Jul  1 02:54:01 2009
> @@ -857,6 +857,10 @@
>                  if (UtilProperties.propertyValueEquals("webslinger-invoker.properties", "wrap-calls", "true")) {
>                      Wrap<MethodOperation> wrap = new Wrap<MethodOperation>().fileName(simpleMethod.getLocationAndName()).wrappedClass(methodOp.getClass());
>                      wrap.wrap(methodOperationExecMethod);
> +                    Object startLine = curOperElem.getUserData("startLine");
> +                    if (startLine != null) {
> +                        wrap.lineNumber(((Integer) startLine).intValue());
> +                    }
>                      methodOp = wrap.newInstance(new Class<?>[] {Element.class, SimpleMethod.class}, new Object[] {curOperElem, simpleMethod});
>                  }
>                  methodOperations.add(methodOp);

If one edits framework/base/config/webslinger-invoker.properties,
setting wrap-calls=true, then if one has an exception thrown in a
SimpleMethod operation, then one will get an exception stack trace as
below:

org.ofbiz.entity.GenericDelegator.createOrStore(GenericDelegator.java:871)
org.ofbiz.minilang.method.entityops.CreateValue.exec(CreateValue.java:76)
_$gen.file_58$.usr.share.ofbiz.applications.content.script.org.ofbiz.content.website.WebSiteServices_46$xml_35$createWebSiteRole.exec(file:/usr/share/ofbiz/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml#createWebSiteRole:133)
org.ofbiz.minilang.SimpleMethod.runSubOps(SimpleMethod.java:926)
org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:744)