Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[METASVC-152] Add detailed error message to WEMI filling procedure #222

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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