Using CrudListener I can delegate the CRUD operations to a custom logical unit. But how to deal with backend errors, For example, when my database raises an error due to referential integrity violation and the delete operation do not perform.
IMO if the CrudListener throws an exception, the error message should be reported and the operation should break. This should be a part of the framework. Currently, a success message is reported even if the backend operation fails - showNotification(successMessage) is optimistic hard coded.
operationPerformedClickEvent -> {
buttonClickListener.onComponentEvent(operationPerformedClickEvent);
if (!clickRowToUpdate) {
crudLayout.hideForm();
}
showNotification(successMessage);
Using CrudListener I can delegate the CRUD operations to a custom logical unit. But how to deal with backend errors, For example, when my database raises an error due to referential integrity violation and the delete operation do not perform.
IMO if the
CrudListener
throws an exception, the error message should be reported and the operation should break. This should be a part of the framework. Currently, a success message is reported even if the backend operation fails -showNotification(successMessage)
is optimistic hard coded.