IDEMPIERE-5366 Better error reporting on Pack In failure (#1422)
[pipo] Throw useful exception when table not found With this commit, Pack In will throw an informative error message if it can't find a table (including the table name). Without this fix, you simply get an NPE which doesn't help with debugging. IDEMPIERE-5366 #resolve
This commit is contained in:
parent
27c5d0fa53
commit
00daca9c94
|
@ -48,6 +48,9 @@ public class POFinder {
|
|||
if (AD_Client_ID==0)
|
||||
return uuid;
|
||||
MTable table = MTable.get(ctx, tableName);
|
||||
if (table == null) {
|
||||
throw new IllegalStateException("getTargetUUID couldn't find table named " + tableName);
|
||||
}
|
||||
String sql = "SELECT Target_UUID FROM AD_Package_UUID_Map WHERE AD_Client_ID=? AND AD_Table_ID=? AND Source_UUID=?";
|
||||
String uid = DB.getSQLValueString(trxName, sql, AD_Client_ID, table.getAD_Table_ID(), uuid);
|
||||
return Util.isEmpty(uid) ? uuid : uid;
|
||||
|
|
Loading…
Reference in New Issue