Hi Harsh,

Please refer to what is usually done for that, eg

in a service

        } catch (GenericEntityException e) {
            Debug.logWarning(e, module);
            Map<String, String> messageMap = UtilMisc.toMap("errMessage", 
e.getMessage());
            errMsg = UtilProperties.getMessage("CommonUiLabels", 
"CommonDatabaseProblem", messageMap, locale);
            return ServiceUtil.returnError(errMsg);
        }

in a worker or such

        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return 
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                    "AccountingBillingAccountNotFound",
                    UtilMisc.toMap("billingAccountId", billingAccountId), 
locale));
        }

YMMV, you may find more examples types, though we should have as less as 
possible such types...

Jacques



Le 29/08/2016 à 10:17, Harsh Vijaywargiya a écrit :
Thanks Jacques for review comment. I think in such case it could be better to uncomment such log statements from Exception block, right? or we should leave it as is?

Thanks & Regards,
Harsh


On Saturday 27 August 2016 06:19 PM, Jacques Le Roux wrote:
Hi Ashish, Harsh,

Please don't let swallowed exceptions in code, there were 2 opportunities here 
;)

Thanks


Le 27/08/2016 à 13:27, [email protected] a écrit :
Author: ashish
Date: Sat Aug 27 11:27:47 2016
New Revision: 1757991

URL: http://svn.apache.org/viewvc?rev=1757991&view=rev
Log:
Applied patch from jira issue - OFBIZ-7848 - Clean up commented out code in 
Java source for Manufacturing.
Thanks Harsh for the contribution.

Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
 Sat Aug 27 11:27:47 2016
@@ -436,7 +433,7 @@ public class BOMNode {
                      this.quantity = calcQuantity;
                  }
              } catch (GenericServiceException e) {
-                //Debug.logError(e, "Problem calling the getManufacturingComponents 
service", module);
+
              }
          } else {
              this.quantity = 
quantity.multiply(quantityMultiplier).multiply(scrapFactor);
@@ -576,7 +573,7 @@ public class BOMNode {
                      }
                  }
              } catch (GenericEntityException e) {
-                //Debug.logError(e, "Problem calling the getManufacturingComponents 
service", module);
+
              }
          }
          return UtilMisc.toMap("productionRunId", productionRunId, "endDate", 
endDate);





Reply via email to