Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6888

GroovyEngine.serviceInvoker masks Groovy script exceptions in some cases

    Details

    • Flags:
      Patch

      Description

      If GroovyEngine.serviceInvoker catches an exception in a Groovy script, it would mask the exception in some cases. An exception's detailMessage can be null. If it is null, the exception won't be properly returned and logged, and that will make spotting problems very difficult. This was the case for me while trying to track down a problem with a java.util.ConcurrentModificationException error in a Groovy script. I suspect that this choice to mask exceptions and only return the message has cause bugs to not be spotted.

      Disabling this for now in favor of returning a proper exception. GroovyEngine.serviceInvoker() should throw GenericServiceException if error, rather than returning ServiceUtil.returnError(e.getMessage())

      1. OFBIZ-6888.patch
        1.0 kB
        Forrest Rae

        Issue Links

          Activity

          Hide
          fbr@14x.net Forrest Rae added a comment -

          Patch to fix issue.

          Show
          fbr@14x.net Forrest Rae added a comment - Patch to fix issue.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks Forrest,

          Your patch is in
          trunk r1734269
          R15.12 r1734270
          R14.12 r1734271
          R13.07 r1734272
          R12.04 r1734273

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks Forrest, Your patch is in trunk r1734269 R15.12 r1734270 R14.12 r1734271 R13.07 r1734272 R12.04 r1734273

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              fbr@14x.net Forrest Rae
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development