svn commit: r1866985 - /ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1866985 - /ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy

jleroux@apache.org
Author: jleroux
Date: Mon Sep 16 08:13:19 2019
New Revision: 1866985

URL: http://svn.apache.org/viewvc?rev=1866985&view=rev
Log:
Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch
blocks.
To avoid such exception swallowing this should be improved to at least log the
error and also return error in case of service.

Missed this one in last commit

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy

Modified: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy?rev=1866985&r1=1866984&r2=1866985&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/ComputeProductSellThroughData.groovy Mon Sep 16 08:13:19 2019
@@ -20,6 +20,8 @@
 import java.math.MathContext
 import java.sql.Timestamp
 
+import org.apache.ofbiz.base.util.Debug
+
 
 if (parameters.fromDateSellThrough) {
     Timestamp fromDate = null
@@ -27,7 +29,9 @@ if (parameters.fromDateSellThrough) {
     try {
         fromDate = Timestamp.valueOf(parameters.fromDateSellThrough)
         thruDate = Timestamp.valueOf(parameters.thruDateSellThrough)
-    } catch(Exception e) {}
+    } catch (Exception e) {
+        Debug.logError(e, "ComputeProductSellThroughData.groovy");
+    }
     inventoryCountResult = runService('countProductInventoryOnHand', [productId : productId, facilityId : facilityId, inventoryCountDate : fromDate, userLogin : userLogin])
     if (inventoryCountResult.quantityOnHandTotal && inventoryCountResult.quantityOnHandTotal > 0) {
         inventoryShippedForSalesResult = runService('countProductInventoryShippedForSales', [productId : productId, facilityId : facilityId, fromDate : fromDate, thruDate : thruDate, userLogin : userLogin])