From ea3620f953a698ec8eae4558394d875993a82a57 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 15:14:28 -0500 Subject: [PATCH] IDEMPIERE-604 Fix implementation hiding SQL errors from user - all SQL errors are being shown as "timeout error" --- org.adempiere.base/src/org/compiere/model/GridTable.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 55b065330c..6edf5aca40 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -1056,6 +1056,12 @@ public class GridTable extends AbstractTableModel {} loops++; } + if (m_sort.size() == 0) { + // check if there is a DB error saved to show + Exception savedEx = CLogger.retrieveException(); + if (savedEx != null) + throw new IllegalStateException(savedEx); + } if (row >= m_sort.size()) { throw new IllegalStateException("Timeout loading row " + (row+1)); } @@ -3512,7 +3518,8 @@ public class GridTable extends AbstractTableModel } catch (SQLException e) { - log.log(Level.SEVERE, m_SQL, e); + log.saveError(e.getLocalizedMessage(), e); + throw new DBException(e); } }