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:
Jacques Le Roux
2018-02-15 11:01:41 +00:00
parent 6a5ffb512e
commit 4e721f189b
3 changed files with 11 additions and 5 deletions
@@ -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")
}
}
}
@@ -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")
}
}
@@ -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")
}
}