Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341) Fixes few remaining swallowed Exception in Groovy files. Not sure if always showing an error message in ui is a good idea. But this should not happen too often and could help users to fix wrong passed numbers... git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+6
-3
@@ -181,7 +181,8 @@ if (action) {
|
||||
checkTime = UtilDateTime.toTimestamp(cal.getTime())
|
||||
searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
Debug.logError(e, "Caught an exception : " + e.toString(), module)
|
||||
request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +279,8 @@ if (action) {
|
||||
try {
|
||||
salesUsageQuantity += salesUsageItem.getDouble("quantity").doubleValue()
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
Debug.logError(e, "Caught an exception : " + e.toString(), module)
|
||||
request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +301,8 @@ if (action) {
|
||||
try {
|
||||
productionUsageQuantity += productionUsageItem.getDouble("quantity").doubleValue()
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
Debug.logError(e, "Caught an exception : " + e.toString(), module)
|
||||
request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -174,7 +174,8 @@ if (action) {
|
||||
checkTime = UtilDateTime.toTimestamp(cal.getTime())
|
||||
searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
Debug.logError(e, "Caught an exception : " + e.toString(), module)
|
||||
request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -216,8 +216,10 @@ if (productIdToReceive) {
|
||||
if (productQtyToReceive) {
|
||||
try {
|
||||
quantity = Double.parseDouble(productQtyToReceive)
|
||||
} catch (Exception e) {
|
||||
} catch (NumberFormatException nfe) {
|
||||
// Ignore the quantity update if there's a problem parsing it
|
||||
Debug.logError(nfe, "Caught an exception : " + nfe.toString(), module)
|
||||
request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user