ChangeJson: Catch RuntimeException in fallback check handlers

There are almost certainly more bugs like I439dfc2cd lurking, where a
missing database entity results in a NullPointerException, and falling
back to the check-only path would be more useful than letting the
error propagate.

Change-Id: If8b6e969fcebf2388753c9cc2e1eed1533a6cbbc
This commit is contained in:
Dave Borowitz
2014-12-04 12:26:14 -08:00
parent 3be39d0291
commit d08c8b94ff

View File

@@ -239,7 +239,7 @@ public class ChangeJson {
ChangeInfo res = toChangeInfo(cd, reviewed, limitToPsId);
accountLoader.fill();
return res;
} catch (OrmException e) {
} catch (OrmException | RuntimeException e) {
if (!has(CHECK)) {
throw e;
}
@@ -289,7 +289,7 @@ public class ChangeJson {
if (i == null) {
try {
i = toChangeInfo(cd, reviewed, Optional.<PatchSet.Id> absent());
} catch (OrmException e) {
} catch (OrmException | RuntimeException e) {
if (has(CHECK)) {
i = checkOnly(cd);
} else {