Fixed error that previous fix caused

This commit is contained in:
Justin Dar 2021-09-10 12:36:11 -07:00
parent 77845d66f7
commit 2163e6e548
2 changed files with 7 additions and 4 deletions

View File

@ -34,6 +34,7 @@ import ca.uhn.fhir.jpa.util.MemoryCacheService;
import ca.uhn.fhir.jpa.util.QueryChunker;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import com.google.common.annotations.VisibleForTesting;
@ -204,7 +205,12 @@ public class IdHelperService {
*/
@Nonnull
public List<ResourcePersistentId> resolveResourcePersistentIdsWithCache(RequestPartitionId theRequestPartitionId, List<IIdType> theIds) {
theIds.forEach(id -> Validate.isTrue(id.hasIdPart()));
try {
theIds.forEach(id -> Validate.isTrue(id.hasIdPart()));
} catch (IllegalArgumentException e) {
ourLog.error("Illegal Argument during database access", e);
throw new InvalidRequestException("Parameter value missing in request", e);
}
if (theIds.isEmpty()) {
return Collections.emptyList();

View File

@ -1207,9 +1207,6 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc {
} catch (IOException e) {
ourLog.error("IO failure during database access", e);
throw new InternalErrorException(e);
} catch (IllegalArgumentException e) {
ourLog.error("Illegal Argument during database access", e);
throw new InvalidRequestException("Parameter value missing in request", e);
}
}
}