No functional changes, just formatting and grouping exceptions
@@ -41,7 +41,6 @@ import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.content.content.ContentWorker;
import org.apache.ofbiz.content.data.DataResourceWorker;
import org.apache.ofbiz.entity.Delegator;
-import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.entity.util.EntityUtilProperties;
@@ -110,7 +109,11 @@ public class SimpleContentViewHandler extends AbstractViewHandler {
if (Debug.verboseOn()) Debug.logVerbose("dataResourceId:" + dataResourceId, module);
}
} else {
- GenericValue contentRevisionItem = EntityQuery.use(delegator).from("ContentRevisionItem").where("contentId", rootContentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId).cache().queryOne();
+ GenericValue contentRevisionItem = EntityQuery.use(delegator)
+ .from("ContentRevisionItem")
+ .where("contentId", rootContentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId)
+ .cache()
+ .queryOne();
if (contentRevisionItem == null) {
throw new ViewHandlerException("ContentRevisionItem record not found for contentId=" + rootContentId
+ ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId);
@@ -182,11 +185,7 @@ public class SimpleContentViewHandler extends AbstractViewHandler {
}
UtilHttp.streamContentToBrowser(response, bais, byteBuffer.limit(), contentType2, fileName);
}
- } catch (GenericEntityException e) {
- throw new ViewHandlerException(e.getMessage());
- } catch (IOException e) {
- throw new ViewHandlerException(e.getMessage());
- } catch (GeneralException e) {
+ } catch (IOException | GeneralException e) {
throw new ViewHandlerException(e.getMessage());
}
}
