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

GroovyEngine.serviceInvoker masks Groovy script exceptions in some cases

    XMLWordPrintableJSON

Details

    • 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())

      Attachments

        1. OFBIZ-6888.patch
          1.0 kB
          Forrest Rae

        Issue Links

          Activity

            People

              jleroux Jacques Le Roux
              fbr@14x.net Forrest Rae
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: