details:   https://code.openbravo.com/erp/devel/pi/rev/e97908638273
changeset: 28704:e97908638273
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Mar 08 09:36:55 2016 +0100
summary:   related to issue 32429: code review improvements

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
 |  18 +++++----
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (35 lines):

diff -r 88d23d650314 -r e97908638273 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Tue Mar 08 08:54:17 2016 +0100
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Tue Mar 08 09:36:55 2016 +0100
@@ -675,10 +675,9 @@
         return result;
       } catch (Throwable t) {
         Throwable localThrowable = DbUtility.getUnderlyingSQLException(t);
-        if (!(localThrowable instanceof OBException)
-            || (localThrowable instanceof OBException && ((OBException) 
localThrowable)
-                .isLogExceptionNeeded())) {
-          log.error(localThrowable.getMessage(), localThrowable);
+        if (!(localThrowable instanceof OBException && !((OBException) 
localThrowable)
+            .isLogExceptionNeeded())) {
+          log.error("Error removing object of " + entityName + " entity", 
localThrowable);
         }
         return JsonUtils.convertExceptionToJson(t);
       }
@@ -840,10 +839,13 @@
       }
     } catch (Throwable t) {
       Throwable localThrowable = DbUtility.getUnderlyingSQLException(t);
-      if (!(localThrowable instanceof OBException)
-          || (localThrowable instanceof OBException && ((OBException) 
localThrowable)
-              .isLogExceptionNeeded())) {
-        log.error(localThrowable.getMessage(), localThrowable);
+      if (!(localThrowable instanceof OBException && !((OBException) 
localThrowable)
+          .isLogExceptionNeeded())) {
+        if (parameters.containsKey(ADD_FLAG)) {
+          log.error("Error adding new object", localThrowable);
+        } else {
+          log.error("Error updating object", localThrowable);
+        }
       }
       return JsonUtils.convertExceptionToJson(localThrowable);
     }

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to