Fix error message when adding a reviewer that does not exist
If the name given for a reviewer does not match to a user the code falls into trying to match a group. If it also does not match a group, report that neither is found instead of saying "Group Not Found:user@example.com". Change-Id: I09fd4448508430faa4fdd893687f7a0def2e1141
This commit is contained in:
@@ -129,7 +129,13 @@ public class PostReviewers implements RestModifyView<ChangeResource, Input> {
|
||||
Account.Id accountId = accounts.parse(input.reviewer).getAccountId();
|
||||
return putAccount(reviewerFactory.create(rsrc, accountId));
|
||||
} catch (UnprocessableEntityException e) {
|
||||
return putGroup(rsrc, input);
|
||||
try {
|
||||
return putGroup(rsrc, input);
|
||||
} catch (UnprocessableEntityException e2) {
|
||||
throw new UnprocessableEntityException(MessageFormat.format(
|
||||
ChangeMessages.get().reviewerNotFound,
|
||||
input.reviewer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user