Author: arunpatidar
Date: Sat Nov 5 09:30:07 2016
New Revision: 1768168
URL: http://svn.apache.org/viewvc?rev=1768168&view=rev
Log:
Fixed: Catch GenericEntityException and GenericServiceException and other
instead of Exception in Java classes.
(OFBIZ-8909)(OFBIZ-8910)(OFBIZ-8911)(OFBIZ-8912)(OFBIZ-8913)(OFBIZ-8914)(OFBIZ-8915)(OFBIZ-8917)(OFBIZ-8918)(OFBIZ-8919)(OFBIZ-8920)(OFBIZ-8921)(OFBIZ-8922)
Thanks: Divesh Dutta for reporting and Amit Gaadaley for providing patch.
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentUrlFilter.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMHelper.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.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/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/content/PartyContentWrapper.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
ofbiz/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java
ofbiz/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
ofbiz/trunk/specialpurpose/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java
ofbiz/trunk/specialpurpose/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
Sat Nov 5 09:30:07 2016
@@ -2893,6 +2893,10 @@ public class PaymentGatewayServices {
try {
dispatcher.addRollbackService("savePaymentGatewayResponse",
context, true);
delegator.create(pgr);
+ } catch (GenericEntityException gee) {
+ Debug.logError(gee, module);
+ } catch (GenericServiceException gse) {
+ Debug.logError(gse, module);
} catch (Exception e) {
Debug.logError(e, module);
}
@@ -2909,6 +2913,10 @@ public class PaymentGatewayServices {
for (GenericValue message : messages) {
delegator.create(message);
}
+ } catch (GenericEntityException gee) {
+ Debug.logError(gee, module);
+ } catch (GenericServiceException gse) {
+ Debug.logError(gse, module);
} catch (Exception e) {
Debug.logError(e, module);
}
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
Sat Nov 5 09:30:07 2016
@@ -31,6 +31,8 @@ import org.apache.ofbiz.entity.Delegator
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.transaction.TransactionUtil;
+import org.apache.ofbiz.entity.transaction.GenericTransactionException;
+
import org.apache.ofbiz.entity.util.EntityListIterator;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.content.content.ContentKeywordIndex;
@@ -108,7 +110,7 @@ public class ContentEvents {
} catch (GenericEntityException e) {
try {
TransactionUtil.rollback(beganTx, e.getMessage(), e);
- } catch (Exception e1) {
+ } catch (GenericTransactionException e1) {
Debug.logError(e1, module);
}
return "error";
@@ -117,7 +119,7 @@ public class ContentEvents {
request.setAttribute("_ERROR_MESSAGE_", t.getMessage());
try {
TransactionUtil.rollback(beganTx, t.getMessage(), t);
- } catch (Exception e2) {
+ } catch (GenericTransactionException e2) {
Debug.logError(e2, module);
}
return "error";
@@ -133,7 +135,7 @@ public class ContentEvents {
// commit the transaction
try {
TransactionUtil.commit(beganTx);
- } catch (Exception e) {
+ } catch (GenericTransactionException e) {
Debug.logError(e, module);
}
}
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentUrlFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentUrlFilter.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentUrlFilter.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentUrlFilter.java
Sat Nov 5 09:30:07 2016
@@ -36,6 +36,7 @@ import org.apache.ofbiz.base.util.UtilHt
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.common.UrlServletHelper;
import org.apache.ofbiz.entity.Delegator;
+import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.webapp.WebAppUtil;
@@ -73,6 +74,8 @@ public class ContentUrlFilter implements
urlContentId = content.getString("contentId");
}
}
+ } catch (GenericEntityException gee) {
+ Debug.logWarning(gee.getMessage(), module);
} catch (Exception e) {
Debug.logWarning(e.getMessage(), module);
}
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
Sat Nov 5 09:30:07 2016
@@ -1181,7 +1181,7 @@ public class ContentWorker implements or
String dataResourceId = null;
try {
dataResourceId = (String) view.get("drDataResourceId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
dataResourceId = (String) view.get("dataResourceId");
}
content.set("dataResourceId", dataResourceId);
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
Sat Nov 5 09:30:07 2016
@@ -102,7 +102,7 @@ public class EditRenderSubContentCacheTr
String dataResourceId = null;
try {
dataResourceId = (String) view.get("drDataResourceId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
dataResourceId = (String) view.get("dataResourceId");
}
String subContentIdSub = (String) view.get("contentId");
@@ -111,7 +111,7 @@ public class EditRenderSubContentCacheTr
if (UtilValidate.isEmpty(subDataResourceTypeId)) {
try {
subDataResourceTypeId = (String)
view.get("drDataResourceTypeId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
// view may be "Content"
}
// TODO: If this value is still empty then it is probably
necessary to get a value from
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
Sat Nov 5 09:30:07 2016
@@ -39,6 +39,7 @@ import freemarker.template.SimpleScalar;
import freemarker.template.TemplateModelException;
import freemarker.template.TemplateTransformModel;
import org.apache.ofbiz.entity.Delegator;
+import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.webapp.WebAppUtil;
@@ -127,6 +128,8 @@ public class OfbizContentAltUrlTransform
url = mountPoint + url;
}
}
+ } catch (GenericEntityException gee) {
+ Debug.logWarning("[Exception] : " + gee.getMessage(), module);
} catch (Exception e) {
Debug.logWarning("[Exception] : " + e.getMessage(), module);
}
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
Sat Nov 5 09:30:07 2016
@@ -86,7 +86,7 @@ public class RenderSubContentCacheTransf
if (view != null) {
try {
dataResourceId = (String) view.get("drDataResourceId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
dataResourceId = (String) view.get("dataResourceId");
}
subContentIdSub = (String) view.get("contentId");
@@ -96,7 +96,7 @@ public class RenderSubContentCacheTransf
if (UtilValidate.isEmpty(subDataResourceTypeId)) {
try {
subDataResourceTypeId = (String)
view.get("drDataResourceTypeId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
// view may be "Content"
}
// TODO: If this value is still empty then it is probably
necessary to get a value from
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
Sat Nov 5 09:30:07 2016
@@ -112,7 +112,7 @@ public class WrapSubContentCacheTransfor
String dataResourceId = null;
try {
dataResourceId = (String) view.get("drDataResourceId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
dataResourceId = (String) view.get("dataResourceId");
}
String subContentIdSub = (String) view.get("contentId");
@@ -121,7 +121,7 @@ public class WrapSubContentCacheTransfor
if (UtilValidate.isEmpty(subDataResourceTypeId)) {
try {
subDataResourceTypeId = (String)
view.get("drDataResourceTypeId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
// view may be "Content"
}
// TODO: If this value is still empty then it is probably
necessary to get a value from
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMHelper.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMHelper.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMHelper.java
Sat Nov 5 09:30:07 2016
@@ -29,6 +29,7 @@ import org.apache.ofbiz.entity.Delegator
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityQuery;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
/** Helper class containing static method useful when dealing
@@ -151,6 +152,10 @@ public final class BOMHelper {
}
dispatcher.runSync("createProductionRunsForOrder", UtilMisc.<String, Object>toMap("quantity", shipmentPlan.getBigDecimal("quantity"),
"orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId"), "shipGroupSeqId",
shipmentPlan.getString("shipGroupSeqId"), "shipmentId", shipmentId, "userLogin", userLogin));
}
+ } catch (GenericEntityException gee) {
+ Debug.logWarning(gee, module);
+ } catch (GenericServiceException gse) {
+ Debug.logWarning(gse, module);
} catch (Exception e) {
// if there is an exception for either, the other probably wont
work
Debug.logWarning(e, module);
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java
Sat Nov 5 09:30:07 2016
@@ -192,6 +192,10 @@ public class BOMServices {
variantProduct.store();
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingBomErrorRunningUpdateLowLevelCode", UtilMisc.toMap("errorString",
gee.getMessage()), locale));
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingBomErrorRunningUpdateLowLevelCode", UtilMisc.toMap("errorString",
gse.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingBomErrorRunningUpdateLowLevelCode", UtilMisc.toMap("errorString",
e.getMessage()), locale));
}
@@ -231,6 +235,8 @@ public class BOMServices {
}
}
// FIXME: also all the variants llc should be updated?
+ } catch (GenericEntityException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingBomErrorRunningInitLowLevelCode", UtilMisc.toMap("errorString",
e.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingBomErrorRunningInitLowLevelCode", UtilMisc.toMap("errorString",
e.getMessage()), locale));
}
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
Sat Nov 5 09:30:07 2016
@@ -35,6 +35,7 @@ import org.apache.ofbiz.entity.GenericVa
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.entity.util.EntityUtil;
import org.apache.ofbiz.manufacturing.techdata.TechDataServices;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
@@ -424,6 +425,8 @@ public class ProductionRun {
Map<String, Object> resultService =
dispatcher.runSync(serviceName, serviceContext);
totalTaskTime =
((BigDecimal)resultService.get("totalTime")).doubleValue();
}
+ } catch (GenericServiceException exc) {
+ Debug.logError(exc, "Problem calling the customMethod service
" + serviceName);
} catch (Exception exc) {
Debug.logError(exc, "Problem calling the customMethod service
" + serviceName);
}
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Sat Nov 5 09:30:07 2016
@@ -156,6 +156,12 @@ public class ProductionRunServices {
}
}
}
+ } catch (GenericEntityException e) {
+ Debug.logError(e, "Problem accessing WorkEffortGoodStandard
entity", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
+ } catch (GenericServiceException e) {
+ Debug.logError(e, "Problem calling the updateWorkEffort
service", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
} catch (Exception e) {
Debug.logError(e, "Problem calling the updateWorkEffort
service", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
@@ -839,6 +845,10 @@ public class ProductionRunServices {
serviceContext.put("userLogin", userLogin);
dispatcher.runSync("issueProductionRunTask",
serviceContext);
}
+ } catch (GenericServiceException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
+ } catch (GenericEntityException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
}
@@ -951,6 +961,8 @@ public class ProductionRunServices {
dispatcher.runSync("createCostComponent", inMap);
}
}
+ } catch(GenericServiceException gse) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToFindOverheadCosts",
UtilMisc.toMap("errorString", gse.getMessage()), locale));
} catch(Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToFindOverheadCosts",
UtilMisc.toMap("errorString", e.getMessage()), locale));
}
@@ -1025,6 +1037,10 @@ public class ProductionRunServices {
totalCost = totalCost.add(taskCost);
}
result.put("totalCost", totalCost);
+ } catch (GenericEntityException exc) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToFindCosts", locale) + " " + workEffortId + "
" + exc.getMessage());
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToFindCosts", locale) + " " + workEffortId + "
" + exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToFindCosts", locale) + " " + workEffortId + "
" + exc.getMessage());
}
@@ -1141,6 +1157,10 @@ public class ProductionRunServices {
dispatcher.runSync("createCostComponent", inMap);
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateRoutingCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
gee.getMessage()), locale));
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateRoutingCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
gse.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateRoutingCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
e.getMessage()), locale));
}
@@ -1171,6 +1191,10 @@ public class ProductionRunServices {
inMap.put("cost", materialsCost);
dispatcher.runSync("createCostComponent", inMap);
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateMaterialsCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
gee.getMessage()), locale));
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateMaterialsCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
gse.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunUnableToCreateMaterialsCosts",
UtilMisc.toMap("productionRunTaskId", productionRunTaskId, "errorString",
e.getMessage()), locale));
}
@@ -1663,6 +1687,9 @@ public class ProductionRunServices {
unitCost = ZERO;
}
+ } catch (GenericServiceException gse) {
+ Debug.logWarning(gse.getMessage(), module);
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
Debug.logWarning(e.getMessage(), module);
return ServiceUtil.returnError(e.getMessage());
@@ -1707,6 +1734,8 @@ public class ProductionRunServices {
serviceContext.put("userLogin", userLogin);
resultService =
dispatcher.runSync("balanceInventoryItems", serviceContext);
}
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(exc.getMessage());
}
@@ -1750,6 +1779,8 @@ public class ProductionRunServices {
serviceContext.put("priorityOrderItemSeqId",
orderItem.getString("orderItemSeqId"));
}
resultService = dispatcher.runSync("balanceInventoryItems",
serviceContext);
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(exc.getMessage());
}
@@ -1909,6 +1940,8 @@ public class ProductionRunServices {
serviceContext.put("userLogin", userLogin);
resultService =
dispatcher.runSync("balanceInventoryItems", serviceContext);
}
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(exc.getMessage());
}
@@ -1949,6 +1982,8 @@ public class ProductionRunServices {
serviceContext.put("inventoryItemId", inventoryItemId);
serviceContext.put("userLogin", userLogin);
resultService = dispatcher.runSync("balanceInventoryItems",
serviceContext);
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(exc.getMessage());
}
@@ -2178,6 +2213,8 @@ public class ProductionRunServices {
serviceContext.put("quantityRejected", totalQuantityRejected);
serviceContext.put("userLogin", userLogin);
dispatcher.runSync("updateWorkEffort", serviceContext);
+ } catch (GenericServiceException exc) {
+ return ServiceUtil.returnError(exc.getMessage());
} catch (Exception exc) {
return ServiceUtil.returnError(exc.getMessage());
}
@@ -2741,6 +2778,12 @@ public class ProductionRunServices {
}
serviceContext.clear();
}
+ } catch (GenericEntityException e) {
+ Debug.logError(e, "Problem accessing the WorkEffort entity",
module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
+ } catch (GenericServiceException e) {
+ Debug.logError(e, "Problem calling the changeProductionRunTaskStatus
service", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
} catch (Exception e) {
Debug.logError(e, "Problem calling the changeProductionRunTaskStatus
service", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunStatusNotChanged", locale));
@@ -2968,6 +3011,12 @@ public class ProductionRunServices {
"userLogin", userLogin);
dispatcher.runSync("decomposeInventoryItem", serviceContext);
}
+ } catch (GenericEntityException e) {
+ Debug.logError(e, "Problem accessing the InventoryItem entity",
module);
+ return ServiceUtil.returnError(e.getMessage());
+ } catch (GenericServiceException e) {
+ Debug.logError(e, "Problem calling the checkDecomposeInventoryItem
service", module);
+ return ServiceUtil.returnError(e.getMessage());
} catch (Exception e) {
Debug.logError(e, "Problem calling the checkDecomposeInventoryItem
service", module);
return ServiceUtil.returnError(e.getMessage());
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
Sat Nov 5 09:30:07 2016
@@ -736,6 +736,8 @@ public class MrpServices {
Map<String, Object> serviceResponse = null;
try {
serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String,
Object>toMap("productId", product.getString("productId"), "quantity", positiveEventQuantity,
"excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
+ } catch (GenericServiceException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingMrpErrorExplodingProduct", UtilMisc.toMap("productId",
product.getString("productId")), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingMrpErrorExplodingProduct", UtilMisc.toMap("productId",
product.getString("productId")), locale));
}
@@ -768,6 +770,8 @@ public class MrpServices {
Map<String, Object> serviceResponse = null;
try {
serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String,
Object>toMap("productId", product.getString("productId"), "quantity", proposedOrder.getQuantity(),
"excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
+ } catch (GenericServiceException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingMrpErrorExplodingProduct", UtilMisc.toMap("productId",
product.getString("productId")), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingMrpErrorExplodingProduct", UtilMisc.toMap("productId",
product.getString("productId")), locale));
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
Sat Nov 5 09:30:07 2016
@@ -2683,6 +2683,10 @@ public class OrderServices {
Map<String, Object> sendResp = null;
try {
sendResp = dispatcher.runSync("sendMailFromScreen", sendMap);
+ } catch (GenericServiceException e) {
+ Debug.logError(e, module);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
+ "OrderServiceExceptionSeeLogs",locale));
} catch (Exception e) {
Debug.logError(e, module);
return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
@@ -5975,7 +5979,7 @@ public class OrderServices {
try {
message =
validateOrderItemShipGroupAssoc(delegator, dispatcher, orderItem,
totalQuantity, oisga, userLogin, locale);
}
- catch (Exception e) {
+ catch (GeneralException e) {
String errMsg = mainErrorMessage +
UtilProperties.getMessage(resource_error,
"OrderQuantityAssociatedIsLessThanOrderItemQuantity", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
Sat Nov 5 09:30:07 2016
@@ -126,6 +126,9 @@ public class QuoteServices {
Map<String, Object> sendResp = null;
try {
sendResp = dispatcher.runSync("sendMailFromScreen", sendMap);
+ } catch (GenericServiceException e) {
+ Debug.logError(e, module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderServiceExceptionSeeLogs",locale));
} catch (Exception e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderServiceExceptionSeeLogs",locale));
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
Sat Nov 5 09:30:07 2016
@@ -652,6 +652,19 @@ public class CheckOutHelper {
Debug.logError(ServiceUtil.getErrorMessage(prunResult) +
" for input:" + inputMap, module);
}
}
+ } catch (GenericEntityException e) {
+ String service = e.getMessage();
+ Map<String, String> messageMap = UtilMisc.toMap("service",
service);
+ String errMsg = "Problem accessing the Product entity";
+ errMsg = errMsg + UtilProperties.getMessage(resource_error,
"checkhelper.could_not_create_order_invoking_service", messageMap, (cart !=
null ? cart.getLocale() : Locale.getDefault()));
+ Debug.logError(e, errMsg, module);
+ return ServiceUtil.returnError(errMsg);
+ } catch (GenericServiceException e) {
+ String service = e.getMessage();
+ Map<String, String> messageMap = UtilMisc.toMap("service",
service);
+ String errMsg = UtilProperties.getMessage(resource_error,
"checkhelper.could_not_create_order_invoking_service", messageMap, (cart !=
null ? cart.getLocale() : Locale.getDefault()));
+ Debug.logError(e, errMsg, module);
+ return ServiceUtil.returnError(errMsg);
} catch (Exception e) {
String service = e.getMessage();
Map<String, String> messageMap =
UtilMisc.toMap("service", service);
@@ -674,6 +687,12 @@ public class CheckOutHelper {
/* OrderRequirementCommitment records will map which POs
which are created from which requirements. With the help of this mapping
requirements will be updated to Ordered when POs will be approved. */
Map<String, Object> inputMap = UtilMisc.toMap("userLogin", userLogin, "orderId",
orderId, "orderItemSeqId", shoppingCartItem.getOrderItemSeqId(), "requirementId", requirementId,
"quantity", shoppingCartItem.getQuantity());
dispatcher.runSync("createOrderRequirementCommitment",
inputMap);
+ } catch (GenericServiceException e) {
+ String service = e.getMessage();
+ Map<String, String> messageMap = UtilMisc.toMap("service",
service);
+ String errMsg = UtilProperties.getMessage(resource_error,
"checkhelper.could_not_create_order_invoking_service", messageMap, (cart !=
null ? cart.getLocale() : Locale.getDefault()));
+ Debug.logError(e, errMsg, module);
+ return ServiceUtil.returnError(errMsg);
} catch (Exception e) {
String service = e.getMessage();
Map<String, String> messageMap =
UtilMisc.toMap("service", service);
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
Sat Nov 5 09:30:07 2016
@@ -69,6 +69,7 @@ import org.apache.ofbiz.product.config.P
import org.apache.ofbiz.product.product.ProductWorker;
import org.apache.ofbiz.product.store.ProductStoreWorker;
import org.apache.ofbiz.service.LocalDispatcher;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.ServiceUtil;
/**
@@ -477,6 +478,8 @@ public class ShoppingCart implements Ite
if ((productSuppliers != null) && (productSuppliers.size() > 0)) {
supplierProduct = productSuppliers.get(0);
}
+ } catch (GenericServiceException e) {
+
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetSuppliersForProductError",
locale) + e.getMessage(), module);
} catch (Exception e) {
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetSuppliersForProductError",
locale) + e.getMessage(), module);
}
@@ -3528,6 +3531,12 @@ public class ShoppingCart implements Ite
}
}
+ } catch (GenericEntityException gse) {
+ Debug.logError(gse, module);
+ return null;
+ } catch (GenericServiceException gse) {
+ Debug.logError(gse, module);
+ return null;
} catch (Exception e) {
Debug.logError(e, module);
return null;
@@ -4153,6 +4162,9 @@ public class ShoppingCart implements Ite
try {
GenericValue productStore = this.getDelegator().findOne("ProductStore",
UtilMisc.toMap("productStoreId", this.getProductStoreId()), true);
facilityId = productStore.getString("inventoryFacilityId");
+ } catch (GenericEntityException gee) {
+
Debug.logError(UtilProperties.getMessage(resource_error,"OrderProblemGettingProductStoreRecords",
locale) + gee.getMessage(), module);
+ return;
} catch (Exception e) {
Debug.logError(UtilProperties.getMessage(resource_error,"OrderProblemGettingProductStoreRecords",
locale) + e.getMessage(), module);
return;
@@ -4210,6 +4222,8 @@ public class ShoppingCart implements Ite
dropShipQuantity =
itemQuantity.subtract(availableToPromise);
}
+ } catch (GenericServiceException gee) {
+
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetInventoryAvailableByFacilityError",
locale) + gee.getMessage(), module);
} catch (Exception e) {
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetInventoryAvailableByFacilityError",
locale) + e.getMessage(), module);
}
@@ -4233,7 +4247,7 @@ public class ShoppingCart implements Ite
if (! UtilValidate.isEmpty(supplierProduct)) {
supplierPartyId =
supplierProduct.getString("partyId");
}
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetSuppliersForProductError",
locale) + e.getMessage(), module);
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
Sat Nov 5 09:30:07 2016
@@ -1469,7 +1469,7 @@ public class ShoppingCartEvents {
orderAdjustments = cart.getAdjustments();
try {
orderAdjustmentList =
EntityQuery.use(delegator).from("OrderAdjustment").where("orderId",
orderId).queryList();
- } catch (Exception e) {
+ } catch (GenericEntityException e) {
Debug.logError(e, module);
}
for (long itr = 1; itr <= groupIndex; itr++) {
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
Sat Nov 5 09:30:07 2016
@@ -564,6 +564,8 @@ public class ShoppingListServices {
}
}
}
+ } catch (GenericEntityException gee) {
+ Debug.logInfo("updateShoppingListQuantitiesFromOrder
error:"+gee.getMessage(), module);
} catch (Exception e) {
Debug.logInfo("updateShoppingListQuantitiesFromOrder
error:"+e.getMessage(), module);
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java
Sat Nov 5 09:30:07 2016
@@ -102,6 +102,8 @@ public class OrderTestServices {
}
}
}
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
@@ -157,6 +159,8 @@ public class OrderTestServices {
try {
dispatcher.runSync("quickShipEntireOrder", UtilMisc.toMap("orderId",
orderId, "userLogin", userLogin));
Debug.logInfo("Test sales order with id [" + orderId + "] has been
shipped", module);
+ } catch (GenericServiceException gse) {
+ Debug.logWarning("Unable to quick ship test sales order with id [" +
orderId + "] with error: " + gse.getMessage(), module);
} catch (Exception exc) {
Debug.logWarning("Unable to quick ship test sales order with id [" +
orderId + "] with error: " + exc.getMessage(), module);
}
Modified:
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/content/PartyContentWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/content/PartyContentWrapper.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/content/PartyContentWrapper.java
(original)
+++
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/content/PartyContentWrapper.java
Sat Nov 5 09:30:07 2016
@@ -99,6 +99,12 @@ public class PartyContentWrapper impleme
public List<String> getList(String contentTypeId) {
try {
return getPartyContentTextList(party, contentTypeId, locale,
mimeTypeId, party.getDelegator(), dispatcher);
+ } catch (GeneralException ge) {
+ Debug.logError(ge, module);
+ return null;
+ } catch (IOException ioe) {
+ Debug.logError(ioe, module);
+ return null;
} catch (Exception e) {
Debug.logError(e, module);
return null;
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
Sat Nov 5 09:30:07 2016
@@ -51,6 +51,7 @@ import org.apache.ofbiz.base.util.string
import org.apache.ofbiz.content.layout.LayoutWorker;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericValue;
+import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.entity.util.EntityUtilProperties;
import org.apache.ofbiz.service.DispatchContext;
@@ -98,6 +99,10 @@ public class FrameImage {
try {
GenericValue contentDataResourceView =
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId",
frameContentId, "drDataResourceId", frameDataResourceId).queryOne();
frameImageName = contentDataResourceView.getString("contentName");
+ } catch (GenericEntityException gee) {
+ Debug.logError(gee, module);
+ result = ServiceUtil.returnError(gee.getMessage());
+ result.putAll(context);
} catch (Exception e) {
Debug.logError(e, module);
result = ServiceUtil.returnError(e.getMessage());
@@ -311,6 +316,9 @@ public class FrameImage {
contentCtx.put("userLogin", userLogin);
Map<String, Object> contentResult =
dispatcher.runSync("createContent", contentCtx);
contentId = contentResult.get("contentId").toString();
+ } catch (GenericServiceException gse) {
+ request.setAttribute("_ERROR_MESSAGE_", gse.getMessage());
+ return "error";
} catch (Exception e) {
request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
return "error";
@@ -359,6 +367,9 @@ public class FrameImage {
try {
GenericValue contentDataResourceView =
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId",
frameContentId, "drDataResourceId", frameDataResourceId).queryOne();
frameImageName = contentDataResourceView.getString("contentName");
+ } catch (GenericEntityException e) {
+ request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+ return "error";
} catch (Exception e) {
request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
return "error";
@@ -413,6 +424,9 @@ public class FrameImage {
try {
GenericValue contentDataResource =
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId",
frameContentId).queryFirst();
frameDataResourceId =
contentDataResource.getString("dataResourceId");
+ } catch (GenericEntityException e) {
+ request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+ return "error";
} catch (Exception e) {
request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
return "error";
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
Sat Nov 5 09:30:07 2016
@@ -33,10 +33,12 @@ import org.apache.ofbiz.base.util.UtilVa
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericValue;
+import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.entity.util.EntityUtilProperties;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.LocalDispatcher;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.ServiceUtil;
public class ReplaceImage{
@@ -114,7 +116,15 @@ public class ReplaceImage{
productContentCtx.put("userLogin", userLogin);
dispatcher.runSync("removeProductContentAndImageFile",
productContentCtx);
}
- } catch (Exception e) {
+ } catch (GenericEntityException gee) {
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotReplaceImage", locale);
+ Debug.logError(errMsg, module);
+ return ServiceUtil.returnError(errMsg);
+ } catch (GenericServiceException gse) {
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotReplaceImage", locale);
+ Debug.logError(errMsg, module);
+ return ServiceUtil.returnError(errMsg);
+ } catch (Exception gse) {
String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotReplaceImage", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
Sat Nov 5 09:30:07 2016
@@ -147,7 +147,7 @@ public class ProductEvents {
} catch (GenericEntityException e) {
try {
TransactionUtil.rollback(beganTx, e.getMessage(), e);
- } catch (Exception e1) {
+ } catch (GenericTransactionException e1) {
Debug.logError(e1, module);
}
return "error";
@@ -156,7 +156,7 @@ public class ProductEvents {
request.setAttribute("_ERROR_MESSAGE_", t.getMessage());
try {
TransactionUtil.rollback(beganTx, t.getMessage(), t);
- } catch (Exception e2) {
+ } catch (GenericTransactionException e2) {
Debug.logError(e2, module);
}
return "error";
@@ -172,7 +172,7 @@ public class ProductEvents {
// commit the transaction
try {
TransactionUtil.commit(beganTx);
- } catch (Exception e) {
+ } catch (GenericTransactionException e) {
Debug.logError(e, module);
}
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
Sat Nov 5 09:30:07 2016
@@ -177,8 +177,7 @@ public class ShipmentServices {
estimate.set(breakType + "UomId", context.get(prefix +
"uom"));
}
storeAll.add(0, weightBreak);
- }
- catch (Exception e) {
+ } catch (Exception e) {
Debug.logError(e, module);
}
}
@@ -1175,6 +1174,9 @@ public class ShipmentServices {
Map<String, Object> sendResp = null;
try {
sendResp = dispatcher.runSync("sendMailFromScreen", sendMap);
+ } catch (GenericServiceException gse) {
+ Debug.logError(gse, "Problem sending mail", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", localePar));
} catch (Exception e) {
Debug.logError(e, "Problem sending mail", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", localePar));
@@ -1228,6 +1230,10 @@ public class ShipmentServices {
"ProductStoreShipmentMethodNotFound",
UtilMisc.toMap("shipmentId", shipmentId), locale));
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "FacilityShipmentGatewayConfigFromShipmentError",
+ UtilMisc.toMap("errorString", gee.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"FacilityShipmentGatewayConfigFromShipmentError",
Modified:
ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
(original)
+++
ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
Sat Nov 5 09:30:07 2016
@@ -1039,7 +1039,7 @@ public class WorkEffortServices {
Map<String, Object> emailCtx = UtilMisc.toMap("emailTemplateSettingId",
"WEFF_EVENT_REMINDER", "sendTo", toAddress, "bodyParameters", parameters);
try {
dispatcher.runAsync("sendMailFromTemplateSetting",
emailCtx);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logWarning("Error while emailing event reminder - workEffortId = " +
reminder.get("workEffortId") + ", contactMechId = " + reminder.get("contactMechId") + ":
" + e, module);
}
} else {
Modified:
ofbiz/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java
(original)
+++
ofbiz/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java
Sat Nov 5 09:30:07 2016
@@ -571,6 +571,8 @@ public class EntitySyncServices {
}
// TODO create a response document to send back to the initial sync machine
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"EntityExtUnableToLoadXMLDocument", UtilMisc.toMap("entitySyncId", entitySyncId,
"startTime", startTime, "errorString", gse.getMessage()), locale));
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"EntityExtUnableToLoadXMLDocument", UtilMisc.toMap("entitySyncId", entitySyncId,
"startTime", startTime, "errorString", e.getMessage()), locale));
}
Modified:
ofbiz/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
(original)
+++
ofbiz/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
Sat Nov 5 09:30:07 2016
@@ -86,6 +86,7 @@ import org.apache.ofbiz.entityext.Entity
import org.apache.ofbiz.security.Security;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.LocalDispatcher;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.ServiceUtil;
import org.apache.ofbiz.webtools.artifactinfo.ArtifactInfoFactory;
import org.apache.ofbiz.webtools.artifactinfo.ServiceArtifactInfo;
@@ -193,6 +194,8 @@ public class WebToolsServices {
Long numberRead = (Long)outputMap.get("rowProcessed");
messages.add(UtilProperties.getMessage(resource,
"EntityImportRowProcessed", UtilMisc.toMap("numberRead",
numberRead.toString()), locale));
}
+ } catch (GenericServiceException gsex) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"EntityImportParsingError", UtilMisc.toMap("errorString", gsex.getMessage()),
locale));
} catch (Exception ex) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"EntityImportParsingError", UtilMisc.toMap("errorString", ex.getMessage()),
locale));
}
Modified:
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
(original)
+++
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
Sat Nov 5 09:30:07 2016
@@ -111,7 +111,7 @@ public class MenuWrapTransform implement
String dataResourceId = null;
try {
dataResourceId = (String) view.get("drDataResourceId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
dataResourceId = (String) view.get("dataResourceId");
}
String subContentIdSub = (String) view.get("contentId");
@@ -120,7 +120,7 @@ public class MenuWrapTransform implement
if (UtilValidate.isEmpty(subDataResourceTypeId)) {
try {
subDataResourceTypeId = (String)
view.get("drDataResourceTypeId");
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
// view may be "Content"
}
// TODO: If this value is still empty then it is probably
necessary to get a value from
Modified:
ofbiz/trunk/specialpurpose/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
(original)
+++
ofbiz/trunk/specialpurpose/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
Sat Nov 5 09:30:07 2016
@@ -48,6 +48,7 @@ import org.apache.ofbiz.entity.util.Enti
import org.apache.ofbiz.security.Security;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.LocalDispatcher;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.ServiceUtil;
import org.apache.ofbiz.widget.renderer.ScreenRenderer;
import org.apache.ofbiz.widget.renderer.ScreenStringRenderer;
@@ -257,7 +258,7 @@ public class BirtEmailServices {
} else {
dispatcher.runSync("sendMail", serviceContext);
}
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
String errMsg = UtilProperties.getMessage(resource,
"BirtErrorInSendingEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
Modified:
ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java
(original)
+++
ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java
Sat Nov 5 09:30:07 2016
@@ -221,6 +221,9 @@ public class EbayHelper {
}
}
}
+ } catch (GenericEntityException gee) {
+ Debug.logError(gee, "Cannot get payment preferences for order #" +
orderId, module);
+ return false;
} catch (Exception e) {
Debug.logError(e, "Cannot get payment preferences for order #" +
orderId, module);
return false;
@@ -256,7 +259,10 @@ public class EbayHelper {
return false;
}
return true;
- } catch (Exception e) {
+ } catch (GenericEntityException e) {
+ Debug.logError(e, "Failed to create the payment for order " +
orderId, module);
+ return false;
+ } catch (GenericServiceException e) {
Debug.logError(e, "Failed to create the payment for order " +
orderId, module);
return false;
}
@@ -312,6 +318,8 @@ public class EbayHelper {
partyId = (String) summaryResult.get("partyId");
Debug.logVerbose("Created Customer Party: " + partyId,
module);
}
+ } catch (GenericServiceException e) {
+ Debug.logError(e, "Failed to createPerson", module);
} catch (Exception e) {
Debug.logError(e, "Failed to createPerson", module);
}
@@ -402,7 +410,7 @@ public class EbayHelper {
context.put("contactMechPurposeTypeId", "PHONE_SHIPPING");
summaryResult = dispatcher.runSync("createPartyTelecomNumber",
context);
phoneContactMechId = (String) summaryResult.get("contactMechId");
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, "Failed to createPartyPhone", module);
}
return phoneContactMechId;
@@ -429,7 +437,7 @@ public class EbayHelper {
context.put("userLogin", userLogin);
summaryResult = dispatcher.runSync("createPartyContactMech",
context);
}
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, "Failed to createPartyEmail", module);
}
return emailContactMechId;
@@ -446,7 +454,7 @@ public class EbayHelper {
context.put("attrValue", eias);
context.put("userLogin", userLogin);
summaryResult = dispatcher.runSync("createPartyAttribute",
context);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, "Failed to create eBay EIAS party
attribute");
}
context.clear();
@@ -459,7 +467,7 @@ public class EbayHelper {
context.put("attrValue", ebayUserIdBuyer);
context.put("userLogin", userLogin);
summaryResult = dispatcher.runSync("createPartyAttribute",
context);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, "Failed to create eBay userId party
attribute");
}
}
@@ -482,7 +490,7 @@ public class EbayHelper {
delegator.create(geo);
Debug.logInfo("Creating new geo entity: " + geo, module);
}
- } catch (Exception e) {
+ } catch (GenericEntityException e) {
String errMsg = "Failed to find/setup geo id";
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
@@ -590,7 +598,7 @@ public class EbayHelper {
.equals((phoneNumber.get("contactNumber").toString()))) {
return contactMechId;
}
- } catch (Exception e) {
+ } catch (GenericEntityException e) {
Debug.logError("Problem with verifying phone number for contactMechId "
+ contactMechId + ".", module);
}
}
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
Sat Nov 5 09:30:07 2016
@@ -1089,6 +1089,10 @@ public class EbayEvents {
updateQuantityInventoryProduct(itemObj, productStoreId,
locale, delegator, dispatcher, userLogin);
dispatcher.runSync("exportProductEachItem",
UtilMisc.toMap("itemObject", itemObj));
}
+ } catch (GenericServiceException gse) {
+ Debug.logError(e.getMessage(), module);
+ request.setAttribute("_ERROR_MESSAGE_","Exception:
".concat(gse.getMessage()));
+ return "error";
} catch (Exception e) {
Debug.logError(e.getMessage(), module);
request.setAttribute("_ERROR_MESSAGE_","Exception:
".concat(e.getMessage()));
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java
Sat Nov 5 09:30:07 2016
@@ -868,7 +868,7 @@ public class EbayStore {
inMap.put("userLogin", context.get("userLogin"));
dispatcher.runSync("updateProductStore", inMap);
}
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError("error message"+e, module);
}
}
@@ -1649,7 +1649,11 @@ public class EbayStore {
result.put(ModelService.RESPONSE_MESSAGE,
ModelService.RESPOND_FAIL);
result.put(ModelService.ERROR_MESSAGE_LIST,
ProductsExportToEbay.getproductExportFailureMessageList());
}
- }catch (Exception e) {
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
+ } catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
return result;
@@ -2470,7 +2474,7 @@ public class EbayStore {
if(UtilValidate.isNotEmpty(product)) {
checkResult = true;
}
- } catch(Exception e) {
+ } catch(GenericEntityException e) {
return false;
}
return checkResult;
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
Sat Nov 5 09:30:07 2016
@@ -211,6 +211,8 @@ public class EbayStoreAutoPreferences {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
} catch (Exception e) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource,
"EbayStoreProblemConnectingToEbaySite", locale) + e);
}
@@ -371,7 +373,7 @@ public class EbayStoreAutoPreferences {
try {
dispatcher.runAsync("sendMailFromScreen",
sendMap);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, module);
return
ServiceUtil.returnError(e.getMessage());
}
@@ -494,6 +496,10 @@ public class EbayStoreAutoPreferences {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
@@ -565,6 +571,10 @@ public class EbayStoreAutoPreferences {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
@@ -636,6 +646,10 @@ public class EbayStoreAutoPreferences {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
@@ -704,7 +718,7 @@ public class EbayStoreAutoPreferences {
try {
dispatcher.runAsync("sendMailFromScreen",
sendMap);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, module);
return
ServiceUtil.returnError(e.getMessage());
}
@@ -872,6 +886,8 @@ public class EbayStoreAutoPreferences {
}
}
result = ServiceUtil.returnSuccess();
+ } catch (GenericEntityException e) {
+ result = ServiceUtil.returnError(e.getMessage());
} catch (GenericServiceException e) {
result = ServiceUtil.returnError(e.getMessage());
} catch (Exception e) {
@@ -958,7 +974,7 @@ public class EbayStoreAutoPreferences {
try {
dispatcher.runAsync("sendMailFromScreen",
sendMap);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
Debug.logError(e, module);
return
ServiceUtil.returnError(e.getMessage());
}
@@ -1136,6 +1152,10 @@ public class EbayStoreAutoPreferences {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
+ } catch (GenericServiceException gse) {
+ return ServiceUtil.returnError(gse.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java
Sat Nov 5 09:30:07 2016
@@ -142,6 +142,8 @@ public class EbayStoreCustomerService {
result.put("email", email);
result.put("itemName", itemName);
result.put("quantity", quantity);
+ } catch (GenericEntityException e) {
+ return ServiceUtil.returnError(e.getMessage());
} catch (Exception e) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource,
"EbayStoreErrorFromUpdateContactStatus", locale) + e);
}
@@ -162,6 +164,8 @@ public class EbayStoreCustomerService {
GenericValue ebayUserBestOffer =
EntityQuery.use(delegator).from("EbayUserBestOffer").where("itemId", itemId,
"userId", userId).queryOne();
ebayUserBestOffer.remove();
result.put("productStoreId", productStoreId);
+ } catch (GenericEntityException e) {
+ return ServiceUtil.returnError(e.getMessage());
} catch (Exception e) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource,
"EbayStoreErrorFromDeleteContactStatus", locale) + e);
}
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java
Sat Nov 5 09:30:07 2016
@@ -457,7 +457,9 @@ public class EbayStoreHelper {
}
}
result = ServiceUtil.returnSuccess();
- } catch (Exception e) {
+ } catch (GenericEntityException e) {
+ return ServiceUtil.returnError(e.getMessage());
+ } catch (GenericServiceException e) {
return ServiceUtil.returnError(e.getMessage());
}
return result;
@@ -694,6 +696,8 @@ public class EbayStoreHelper {
}
}
}
+ } catch (GenericEntityException gee) {
+ return ServiceUtil.returnError(gee.getMessage());
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
Modified:
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java
(original)
+++
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java
Sat Nov 5 09:30:07 2016
@@ -47,6 +47,7 @@ import org.apache.ofbiz.order.shoppingca
import org.apache.ofbiz.order.shoppingcart.ShoppingCartItem;
import org.apache.ofbiz.party.party.PartyWorker;
import org.apache.ofbiz.service.DispatchContext;
+import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
@@ -65,7 +66,7 @@ public class EbayStoreOrder {
}
result =
dispatcher.runSync("EbayStoreCreateTransactionShoppingCart", context);
}
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
result = ServiceUtil.returnFailure(e.getMessage());
}
result.put("productStoreId",
context.get("productStoreId").toString());
@@ -78,7 +79,7 @@ public class EbayStoreOrder {
if (UtilValidate.isEmpty(context.get("orderId"))) {
try {
result =
dispatcher.runSync("EbayStoreCreateOrderShoppingCart", context);
- } catch (Exception e) {
+ } catch (GenericServiceException e) {
result = ServiceUtil.returnFailure(e.getMessage());
}
}
Modified:
ofbiz/trunk/specialpurpose/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java?rev=1768168&r1=1768167&r2=1768168&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java
(original)
+++
ofbiz/trunk/specialpurpose/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java
Sat Nov 5 09:30:07 2016
@@ -96,6 +96,12 @@ public abstract class SolrProductSearch
else {
result = ServiceUtil.returnSuccess();
}
+ } catch (GenericEntityException gee) {
+ Debug.logError(gee, gee.getMessage(), module);
+ result = ServiceUtil.returnError(gee.toString());
+ } catch (GenericServiceException gse) {
+ Debug.logError(gse, gse.getMessage(), module);
+ result = ServiceUtil.returnError(gse.toString());
} catch (Exception e) {
Debug.logError(e, e.getMessage(), module);
result = ServiceUtil.returnError(e.toString());