mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Convert QRecord errors and warnings to new QStatusMessage type hierarchy.
This commit is contained in:
@ -37,6 +37,7 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.query.JoinsContext;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
|
||||
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||
import com.kingsrook.qqq.backend.core.model.statusmessages.SystemErrorStatusMessage;
|
||||
import com.kingsrook.qqq.backend.module.rdbms.jdbc.QueryManager;
|
||||
|
||||
|
||||
@ -217,7 +218,7 @@ public class RDBMSDeleteAction extends AbstractRDBMSAction implements DeleteInte
|
||||
catch(Exception e)
|
||||
{
|
||||
LOG.debug("Exception trying to delete [" + tableName + "][" + primaryKey + "]", e);
|
||||
deleteOutput.addRecordWithError(new QRecord(table, primaryKey).withError("Record was not deleted: " + e.getMessage()));
|
||||
deleteOutput.addRecordWithError(new QRecord(table, primaryKey).withError(new SystemErrorStatusMessage("Record was not deleted: " + e.getMessage())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ public class RDBMSUpdateActionTest extends RDBMSActionTest
|
||||
updateInput.setRecords(records);
|
||||
UpdateOutput updateOutput = new UpdateAction().execute(updateInput);
|
||||
assertFalse(updateOutput.getRecords().get(0).getErrors().isEmpty());
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0));
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0).getMessage());
|
||||
}
|
||||
|
||||
{
|
||||
@ -377,7 +377,7 @@ public class RDBMSUpdateActionTest extends RDBMSActionTest
|
||||
updateInput.setRecords(records);
|
||||
UpdateOutput updateOutput = new UpdateAction().execute(updateInput);
|
||||
assertFalse(updateOutput.getRecords().get(0).getErrors().isEmpty());
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0));
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0).getMessage());
|
||||
}
|
||||
|
||||
{
|
||||
@ -393,7 +393,7 @@ public class RDBMSUpdateActionTest extends RDBMSActionTest
|
||||
UpdateOutput updateOutput = new UpdateAction().execute(updateInput);
|
||||
|
||||
assertFalse(updateOutput.getRecords().get(0).getErrors().isEmpty());
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0));
|
||||
assertEquals("Missing value in primary key field", updateOutput.getRecords().get(0).getErrors().get(0).getMessage());
|
||||
|
||||
assertTrue(updateOutput.getRecords().get(1).getErrors().isEmpty());
|
||||
|
||||
|
Reference in New Issue
Block a user