mbien commented on code in PR #314:
URL: https://github.com/apache/maven-indexer/pull/314#discussion_r1187568526
##########
indexer-core/src/main/java/org/apache/maven/index/updater/IndexDataReader.java:
##########
@@ -232,9 +240,15 @@ private IndexDataReadResult readIndexMT(IndexWriter w,
IndexingContext context)
}
if (!errors.isEmpty()) {
- IOException exception = new IOException("Error during load of
index");
- errors.forEach(exception::addSuppressed);
- throw exception;
+ if (errors.stream().allMatch(ex -> ex instanceof IOException || ex
instanceof InterruptedException)) {
+ IOException exception = new IOException("Error during load of
index");
+ errors.forEach(exception::addSuppressed);
+ throw exception;
+ } else {
+ RuntimeException exception = new RuntimeException("Error
during load of index");
+ errors.forEach(exception::addSuppressed);
+ throw exception;
+ }
}
Review Comment:
I thought it is probably better to rethrow non-checked exceptions as RT
exception (?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]