add initial exception

This commit is contained in:
Terry W Brady
2018-05-08 15:55:41 -07:00
parent b60fecbb0a
commit 69c62d33ca

View File

@@ -96,6 +96,10 @@ public class CommunityRestRepository extends DSpaceRestRepository<CommunityRest,
// with pagination and authorization check // with pagination and authorization check
@SearchRestMethod(name = "subCommunities") @SearchRestMethod(name = "subCommunities")
public Page<CommunityRest> findSubCommunities(@Param(value = "parent") UUID parentCommunity, Pageable pageable) { public Page<CommunityRest> findSubCommunities(@Param(value = "parent") UUID parentCommunity, Pageable pageable) {
if (parentCommunity == null) {
throw new IllegalArgumentException("Missing parameter 'parent'. "
+ "This parameter should contain the UUID of a parent community");
}
Context context = obtainContext(); Context context = obtainContext();
List<Community> subCommunities = new ArrayList<Community>(); List<Community> subCommunities = new ArrayList<Community>();
try { try {