Skip to content

Commit 781cced

Browse files
committed
propagate the error rather than log it
fixes #4411
1 parent 78ad87a commit 781cced

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,14 @@ private void storeFile(History histNew, File file, Repository repo, boolean merg
378378
safelyRename(outputFile, cacheFile);
379379
}
380380

381-
private void finishStore(Repository repository, String latestRev) {
381+
private void finishStore(Repository repository, String latestRev) throws CacheException {
382382
String histDir = CacheUtil.getRepositoryCacheDataDirname(repository, this);
383383
if (histDir == null || !(new File(histDir)).isDirectory()) {
384384
// If the history was not created for some reason (e.g. temporary
385385
// failure), do not create the CachedRevision file as this would
386386
// create confusion (once it starts working again).
387-
LOGGER.log(Level.WARNING,
388-
"Could not store history for repository {0}: ''{1}'' is not a directory",
389-
new Object[]{repository, histDir});
387+
throw new CacheException(String.format("Could not store history for repository %s: '%s' is not a directory",
388+
repository, histDir));
390389
} else {
391390
storeLatestCachedRevision(repository, latestRev);
392391
}

0 commit comments

Comments
 (0)