Provide a nicer error message for CLA failure
Change-Id: I001f9ef3d428771a77f0d881877e8bf590d91448
This commit is contained in:
@@ -108,7 +108,11 @@ public class ContributorAgreementsChecker {
|
||||
|
||||
if (!iUser.getEffectiveGroups().containsAnyOf(okGroupIds)) {
|
||||
final StringBuilder msg = new StringBuilder();
|
||||
msg.append("A Contributor Agreement must be completed before uploading");
|
||||
msg.append("No Contributor Agreement on file for user ")
|
||||
.append(iUser.getNameEmail())
|
||||
.append(" (id=")
|
||||
.append(iUser.getAccountId())
|
||||
.append(")");
|
||||
if (canonicalWebUrl != null) {
|
||||
msg.append(":\n\n ");
|
||||
msg.append(canonicalWebUrl);
|
||||
|
||||
@@ -177,7 +177,7 @@ public class AgreementsIT extends AbstractDaemonTest {
|
||||
setApiUser(user);
|
||||
setUseContributorAgreements(InheritableBoolean.TRUE);
|
||||
exception.expect(AuthException.class);
|
||||
exception.expectMessage("A Contributor Agreement must be completed");
|
||||
exception.expectMessage("Contributor Agreement");
|
||||
gApi.changes().id(change.changeId).revert();
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class AgreementsIT extends AbstractDaemonTest {
|
||||
in.destination = dest.ref;
|
||||
in.message = change.subject;
|
||||
exception.expect(AuthException.class);
|
||||
exception.expectMessage("A Contributor Agreement must be completed");
|
||||
exception.expectMessage("Contributor Agreement");
|
||||
gApi.changes().id(change.changeId).current().cherryPick(in);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ public class AgreementsIT extends AbstractDaemonTest {
|
||||
gApi.changes().create(newChangeInput());
|
||||
fail("Expected AuthException");
|
||||
} catch (AuthException e) {
|
||||
assertThat(e.getMessage()).contains("A Contributor Agreement must be completed");
|
||||
assertThat(e.getMessage()).contains("Contributor Agreement");
|
||||
}
|
||||
|
||||
// Sign the agreement
|
||||
|
||||
Reference in New Issue
Block a user