Skip to content

Commit

Permalink
mid-7287 handling object loading exception in gui part
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 7, 2021
1 parent af14210 commit f30921a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.*;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.page.error.PageError;

import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
Expand Down Expand Up @@ -290,7 +292,9 @@ public static <T extends ObjectType> PrismObject<T> loadObject(Class<T> type, St
if (WebComponentUtil.showResultInPage(subResult)) {
page.showResult(subResult);
}

if (!allowNotFound) {
throw new RestartResponseException(PageError.class);
}
LOGGER.debug("Loaded {} with result {}", object, subResult);

return object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private PrismObject<O> loadPrismObject() {
prismObject = getPrismContext().createObject(getType());
} else {
String focusOid = getObjectOidParameter();
prismObject = WebModelServiceUtils.loadObject(getType(), focusOid, getOperationOptions(), this, task, result);
prismObject = WebModelServiceUtils.loadObject(getType(), focusOid, getOperationOptions(), false,this, task, result);
LOGGER.trace("Loading object: Existing object (loadled): {} -> {}", focusOid, prismObject);
}
result.recordSuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ public ObjectDetailsModels(LoadableModel<PrismObject<O>> prismObjectModel, Model
@Override
protected PrismObjectWrapper<O> load() {
PrismObject<O> prismObject = prismObjectModel.getObject();
if (prismObject == null) { //can happen, see mid-7287
return null;
}
PrismObjectWrapperFactory<O> factory = modelServiceLocator.findObjectWrapperFactory(prismObject.getDefinition());
Task task = modelServiceLocator.createSimpleTask("createWrapper");
OperationResult result = task.getResult();
Expand Down

0 comments on commit f30921a

Please sign in to comment.