From 45498090f7472048b875500d4abe6498a2f73b52 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 20 Mar 2019 14:43:53 -0300 Subject: [PATCH] IDEMPIERE-3916 Better error message to help locating data problems --- .../src/org/idempiere/process/MoveClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/idempiere/process/MoveClient.java b/org.adempiere.base/src/org/idempiere/process/MoveClient.java index e8e449c023..c508e885a7 100644 --- a/org.adempiere.base/src/org/idempiere/process/MoveClient.java +++ b/org.adempiere.base/src/org/idempiere/process/MoveClient.java @@ -917,7 +917,7 @@ public class MoveClient extends SvrProcess { } if (convertedId < 0) { // not found in the table - try to get it again - could be missed in first pass - convertedId = getLocalIDFor(convertTable, id); + convertedId = getLocalIDFor(convertTable, id, tableName); if (convertedId < 0) { if (("Record_ID".equalsIgnoreCase(columnName) && table.getColumnIndex("AD_Table_ID") > 0) || (("Node_ID".equalsIgnoreCase(columnName) || "Parent_ID".equalsIgnoreCase(columnName)) @@ -1118,7 +1118,7 @@ public class MoveClient extends SvrProcess { } } - private int getLocalIDFor(String tableName, int foreignId) { + private int getLocalIDFor(String tableName, int foreignId, String tableNameSource) { String uuidCol = MTable.getUUIDColumnName(tableName); StringBuilder sqlRemoteUUSB = new StringBuilder() .append("SELECT ").append(uuidCol).append(" FROM ").append(tableName) @@ -1134,7 +1134,7 @@ public class MoveClient extends SvrProcess { if (rs.next()) remoteUUID = rs.getString(1); } catch (SQLException e) { - throw new AdempiereException("Could not execute external query: " + sqlRemoteUU + "\nCause = " + e.getLocalizedMessage()); + throw new AdempiereException("Could not execute external query for table " + tableNameSource + ": " + sqlRemoteUU + "\nCause = " + e.getLocalizedMessage()); } finally { DB.close(rs, stmtUU); }