details:   http://code.openbravo.com/erp/devel/pi/rev/500bea73b740
changeset: 3500:500bea73b740
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Apr 03 09:16:54 2009 +0200
summary:   fixed bug 0008358: When package.module is called without having 
exported the module, the process crashes without any meaningful message

diffstat:

 src/org/openbravo/erpCommon/modules/ExtractModule.java |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r df2d08fb7029 -r 500bea73b740 
src/org/openbravo/erpCommon/modules/ExtractModule.java
--- a/src/org/openbravo/erpCommon/modules/ExtractModule.java    Fri Apr 03 
00:30:48 2009 -0400
+++ b/src/org/openbravo/erpCommon/modules/ExtractModule.java    Fri Apr 03 
09:16:54 2009 +0200
@@ -76,6 +76,14 @@
       log4j.info("Extracting module: " + module.javapackage);
       final String moduleDirectory = modulesBaseDir + "/modules/" + 
module.javapackage;
 
+      if (!(new File(moduleDirectory).exists())) {
+
+        throw new OBException(
+            "Directory "
+                + moduleDirectory
+                + " for module does not exist.\nYou may have not exported 
database before packaging this module");
+      }
+
       relativeDir = modulesBaseDir + File.separator + "modules" + 
File.separator;
       final FileOutputStream file = new FileOutputStream(destDir + "/" + 
module.javapackage + "-"
           + module.version + ".obx");
@@ -89,7 +97,7 @@
       log4j.info("Completed file: " + destDir + "/" + module.javapackage + "-" 
+ module.version
           + ".obx");
     } catch (final Exception e) {
-      e.printStackTrace();
+      log4j.error("Error packaging module", e);
     }
 
   }

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to