Check delete change with PermissionBackend

Deleting the entire change is slightly differently from deleting a
draft patch set.  Update only the change deletion path.

Update test assertions to expect the new generic messages thrown
by the PermissionBackend.

Change-Id: If5a83e386304d8f84db37f6c02f9c35cd5ae4266
This commit is contained in:
Shawn Pearce
2017-02-20 16:53:42 -08:00
committed by David Pursehouse
parent b5798658f5
commit 79ce708c38
8 changed files with 81 additions and 52 deletions

View File

@@ -375,7 +375,7 @@ class ChangeApiImpl implements ChangeApi {
public void delete() throws RestApiException {
try {
deleteChange.apply(change, null);
} catch (UpdateException e) {
} catch (UpdateException | PermissionBackendException e) {
throw new RestApiException("Cannot delete change", e);
}
}

View File

@@ -262,7 +262,7 @@ class RevisionApiImpl implements RevisionApi {
public void delete() throws RestApiException {
try {
deleteDraft.apply(revision, null);
} catch (UpdateException e) {
} catch (UpdateException | OrmException | PermissionBackendException e) {
throw new RestApiException("Cannot delete draft ps", e);
}
}