From abe39e2a437f93017e8d520b1f400ad27ac3f79f Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 20 Feb 2009 11:32:02 +0000 Subject: [PATCH] DBException: improve logging for tester and debugging --- base/src/org/adempiere/exceptions/DBException.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/base/src/org/adempiere/exceptions/DBException.java b/base/src/org/adempiere/exceptions/DBException.java index 591e7b3872..220d87b285 100644 --- a/base/src/org/adempiere/exceptions/DBException.java +++ b/base/src/org/adempiere/exceptions/DBException.java @@ -18,6 +18,8 @@ package org.adempiere.exceptions; import java.sql.SQLException; +import org.compiere.util.CLogMgt; + /** * This RuntimeException is used to pass SQLException up the chain of calling @@ -41,7 +43,11 @@ public class DBException extends AdempiereException public DBException(Exception e) { super(e); - } // DBException + if (CLogMgt.isLevelFinest()) + { + e.printStackTrace(); + } + } /** * Create a new DBException based on a SQLException and SQL Query @@ -50,7 +56,7 @@ public class DBException extends AdempiereException */ public DBException(SQLException e, String sql) { - super(e); + this(e); m_sql = sql; } @@ -61,7 +67,7 @@ public class DBException extends AdempiereException public DBException(String msg) { super(msg); - } // DBException + } /** * @return SQL Query or null