@@ -193,12 +193,12 @@ public void cascadeUpdate(String targetSchema, String targetTable, String target
193193 qus .updateRows (_user , _container , toUpdate , oldPKs , null , new HashMap <>());
194194 }
195195
196- public boolean verifyNotUsed (String targetSchema , String targetTable , String targetField , Object val ) throws SQLException
196+ public boolean verifyNotUsed (String targetSchema , String targetTable , String targetField , Object val , String triggerScriptName ) throws SQLException
197197 {
198- return verifyNotUsed (targetSchema , targetTable , targetField , val , null );
198+ return verifyNotUsed (targetSchema , targetTable , targetField , val , null , triggerScriptName );
199199 }
200200
201- public boolean verifyNotUsed (String targetSchema , String targetTable , String targetField , Object val , @ Nullable String containerPath ) throws SQLException
201+ public boolean verifyNotUsed (String targetSchema , String targetTable , String targetField , Object val , @ Nullable String containerPath , String triggerScriptName ) throws SQLException
202202 {
203203 Container c = _container ;
204204 if (containerPath != null )
@@ -212,14 +212,23 @@ public boolean verifyNotUsed(String targetSchema, String targetTable, String tar
212212
213213 UserSchema us = QueryService .get ().getUserSchema (_user , c , targetSchema );
214214 if (us == null )
215- throw new IllegalArgumentException ("Unknown schema: " + targetSchema );
215+ {
216+ _log .error ("Error running '" + triggerScriptName + "' trigger script. Schema '{}' not found in container '{}'" , targetSchema , c .getName ());
217+ return false ;
218+ }
216219
217220 TableInfo ti = us .getTable (targetTable );
218221 if (ti == null )
219- throw new IllegalArgumentException ("Unknown table: " + targetTable );
222+ {
223+ _log .error ("Error running '" + triggerScriptName + "' trigger script. Table '{}' not found in container '{}'" , targetTable , c .getName ());
224+ return false ;
225+ }
220226
221227 if (ti .getColumn (targetField ) == null )
222- throw new IllegalArgumentException ("Unknown column: " + targetField + " in table: " + targetTable );
228+ {
229+ _log .error ("Error running '" + triggerScriptName + "' trigger script. Column '{}' not found in table '{}'" , targetField , targetTable );
230+ return false ;
231+ }
223232
224233 TableSelector ts = new TableSelector (ti , new SimpleFilter (FieldKey .fromString (targetField ), val ), null );
225234
0 commit comments