Skip to content

Commit

Permalink
Be more specific about runtime exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Sep 12, 2023
1 parent f8380f8 commit ca2910f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private void updateCollection(final Message<JsonObject> aMessage) throws JsonPro
final Stream<Collection.Manifest> stream = collection.getManifests().stream();

try {
// Below can throw a RuntimeException if duplicate IDs are found
// Below can throw a IllegalStateException if duplicate IDs are found
manifestMap.putAll(stream.collect(Collectors.toMap(Collection.Manifest::getID, manifest -> manifest)));

// Next, add the new manifests to the map, replacing any that already exist
Expand All @@ -314,7 +314,7 @@ private void updateCollection(final Message<JsonObject> aMessage) throws JsonPro
error(aMessage, update.cause(), MessageCodes.MFS_152, update.cause().getMessage());
}
});
} catch (final RuntimeException details) {
} catch (final IllegalStateException details) {
LOGGER.error(details, details.getMessage());
aMessage.fail(HTTP.INTERNAL_SERVER_ERROR, details.getMessage());
}
Expand Down

0 comments on commit ca2910f

Please sign in to comment.