ChangeApiImpl: Don't catch RestApiException on rebase

RestApiException (and any subclass of it) is caught and rethrown as
a RestApiException with a generic message. This causes the actual
exception type and message to be lost.

Don't catch RestApiException; allow the original to propagate.

Also add tests in ChangeIT to verify behavior when rebasing with and
without the rebase permission.

Change-Id: Ia303dcf0b7158aafa82adfaeeaabd76a8a980b15
This commit is contained in:
David Pursehouse
2017-03-30 10:54:48 +09:00
parent 50c9b5bdea
commit 52e6bc98b1
2 changed files with 41 additions and 1 deletions

View File

@@ -340,7 +340,7 @@ class ChangeApiImpl implements ChangeApi {
public void rebase(RebaseInput in) throws RestApiException {
try {
rebase.apply(change, in);
} catch (EmailException | OrmException | UpdateException | RestApiException | IOException e) {
} catch (EmailException | OrmException | UpdateException | IOException e) {
throw new RestApiException("Cannot rebase change", e);
}
}