Skip to content

Commit

Permalink
[METASVC-152] Add detailed error message to WEMI filling proc
Browse files Browse the repository at this point in the history
  • Loading branch information
daforster committed Feb 5, 2025
1 parent 527e82b commit c288143
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,23 @@ private void expandByWemiObjects(DigitalObject digitalObject) throws ServiceExce
manifestationsWithWorks.parallelStream()
.filter(m -> Objects.equals(m.getUuid(), item.getManifestation().getUuid()))
.findFirst()
.get(); // must be there otherwise the SQL in getAllManifestationAndWorkUuids is wrong
// must be there otherwise the SQL in getAllManifestationAndWorkUuids is wrong
.orElseThrow(
() ->
new ServiceException(
"""
The item's manifestation could not be found although there must be one!
Item: %s;
Manifestation acc. to item: %s;
DigitalObject: %s
"""
.formatted(
item.getUuid().toString(),
Optional.ofNullable(item.getManifestation())
.map(Manifestation::getUuid)
.map(UUID::toString)
.orElse("<no UUID in manifestation>"),
digitalObject.getUuid().toString())));
item.setManifestation(manifestation);
setNewestLastModified.accept(digitalObject, manifestation);

Expand Down

0 comments on commit c288143

Please sign in to comment.