Skip to content

Commit

Permalink
[BUG] searching-groups-on-a-non-existing-application-result-in-500-er…
Browse files Browse the repository at this point in the history
…ror (776)

Signed-off-by: Sommer Le <[email protected]>
  • Loading branch information
fjr3o6 committed Apr 13, 2023
1 parent cf866d4 commit d1404f8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import fr.insee.sugoi.core.service.GroupService;
import fr.insee.sugoi.model.Group;
import fr.insee.sugoi.model.exceptions.IdNotMatchingException;
import fr.insee.sugoi.model.exceptions.StoreException;
import fr.insee.sugoi.model.paging.PageResult;
import fr.insee.sugoi.model.paging.PageableResult;
import fr.insee.sugoi.services.Utils;
Expand Down Expand Up @@ -111,9 +112,13 @@ public ResponseEntity<PageResult<Group>> getGroups(
filterGroup.setName(name);
filterGroup.setDescription(description);
PageableResult pageableResult = new PageableResult(size, offset, searchCookie);

PageResult<Group> foundGroups =
groupService.findByProperties(realm, applicationName, filterGroup, pageableResult);
PageResult<Group> foundGroups = null;
try {
foundGroups =
groupService.findByProperties(realm, applicationName, filterGroup, pageableResult);
} catch (StoreException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
}

if (foundGroups.isHasMoreResult()) {
URI location =
Expand Down

0 comments on commit d1404f8

Please sign in to comment.