Fixed issue 25241.Fix exception message translation.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 28 Nov 2013 12:15:12 +0100
changeset 21502 7aa7bc25cf8b
parent 21501 68197384f3d3
child 21503 b74b44228aa6
child 21507 ce703e5082ac
Fixed issue 25241.Fix exception message translation.
src/org/openbravo/materialmgmt/ReservationUtils.java
--- a/src/org/openbravo/materialmgmt/ReservationUtils.java	Wed Nov 27 14:44:13 2013 +0100
+++ b/src/org/openbravo/materialmgmt/ReservationUtils.java	Thu Nov 28 12:15:12 2013 +0100
@@ -42,7 +42,6 @@
 import org.openbravo.model.materialmgmt.onhandquantity.StorageDetail;
 import org.openbravo.service.db.CallProcess;
 import org.openbravo.service.db.DalConnectionProvider;
-import org.openbravo.service.db.DbUtility;
 
 public class ReservationUtils {
   String returnValue;
@@ -84,7 +83,8 @@
           new DalConnectionProvider(false), reservation.getId(),
           (String) DalUtil.getId(OBContext.getOBContext().getUser()));
     } catch (ServletException e) {
-      throw new OBException(DbUtility.getUnderlyingSQLException(e));
+      String message = OBMessageUtils.translateError(e.getMessage()).getMessage();
+      throw new OBException(message, e);
     }
 
     String message = "";
@@ -126,7 +126,8 @@
               .toString(), quantity.toString(), (String) DalUtil.getId(OBContext.getOBContext()
               .getUser()), allocated);
     } catch (ServletException e) {
-      throw new OBException(DbUtility.getUnderlyingSQLException(e));
+      String message = OBMessageUtils.translateError(e.getMessage()).getMessage();
+      throw new OBException(message, e);
     }
 
     if (cs != null && cs.returnValue != null) {
@@ -195,7 +196,8 @@
           new DalConnectionProvider(false), reservation.getId(), storageBin.getId(), asi.getId(),
           quantity.toPlainString(), (String) DalUtil.getId(OBContext.getOBContext().getUser()));
     } catch (ServletException e) {
-      throw new OBException(DbUtility.getUnderlyingSQLException(e));
+      String message = OBMessageUtils.translateError(e.getMessage()).getMessage();
+      throw new OBException(message, e);
     }
 
     OBError result = new OBError();