Do not assume DB down if change to index not found

The Gerrit SSH command "index changes" may receive change numbers that
cannot be found or refer to repositories that have problems.

The assumption of "DB is down" when receiving an OrmException was wrong
because the JGit errors were simply wrapped as OrmException and
do not necessarily mean that you cannot continue to process the other
ones in the list.

Change-Id: I1098be16b682dce8d4e63120e7e50f937b19a7b8
This commit is contained in:
Luca Milanesio 2016-12-08 23:16:30 +00:00
parent 27d3f29137
commit 9a52dd1dce
1 changed files with 1 additions and 3 deletions

View File

@ -43,10 +43,8 @@ final class IndexChangesCommand extends SshCommand {
void addChange(String token) {
try {
changeArgumentParser.addChange(token, changes, null, false);
} catch (UnloggedFailure e) {
} catch (UnloggedFailure | OrmException e) {
writeError("warning", e.getMessage());
} catch (OrmException e) {
throw new IllegalArgumentException("database is down", e);
}
}