Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.*;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;

import com.evolveum.midpoint.gui.api.component.data.provider.ISelectableDataProvider;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView;
Expand Down Expand Up @@ -127,7 +129,7 @@ public Iterator<SelectableBean<T>> internalIterator(long offset, long pageSize)

} catch (Exception ex) {
setupUserFriendlyMessage(result, ex);
result.recordFatalError(getPageBase().createStringResource("ObjectDataProvider.message.listObjects.fatalError").getString(), ex);
result.recordFatalError(createListObjectsErrorMessage(ex), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't list objects", ex);
return handleNotSuccessOrHandledErrorInIterator(result);
} finally {
Expand Down Expand Up @@ -179,6 +181,14 @@ protected SelectableBean<T> createDataObjectWrapperForError() {
return new SelectableBeanImpl<>();
}

private String createListObjectsErrorMessage(Exception ex) {
String message = getPageBase().createStringResource("ObjectDataProvider.message.listObjects.fatalError").getString();
if (StringUtils.isBlank(ex.getMessage())) {
return message;
}
return message + ": " + ex.getMessage();
}

protected abstract List<T> searchObjects(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.io.Serial;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -89,7 +90,8 @@ private String getResultAsString(SR selectableBean) {
if (selectableBean instanceof SelectableBean) {
OperationResult result = ((SelectableBean<?>) selectableBean).getResult();
OperationResultStatusPresentationProperties props = OperationResultStatusPresentationProperties.parseOperationalResultStatus(result.getStatus());
return getPageBase().getString(props.getStatusLabelKey());
String status = getPageBase().getString(props.getStatusLabelKey());
return StringUtils.isBlank(result.getMessage()) ? status : status + ": " + result.getMessage();
}
return "";
}
Expand Down
1 change: 1 addition & 0 deletions release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Overall, midPoint 4.10 opens up the world of identity management and governance
* Delineation suggestions: filter parsing broken after recent GUI change. See bug:MID-11175[]
* Fixed work item search by name causing repository mapping error. See bug:MID-8834[]
* Fixed translation of archetype display labels in assignment picker and summary panel. See bug:MID-11177[]
* Fixed generic "Fatal error" message in object tables to show available list/search error details. See bug:MID-10911[]

=== Releases Of Other Components

Expand Down
Loading