ChangeQueryBuilder: Improve error message when is:mergeable is not supported

The "check configs" part of the message is useless for the majority of
users who are unlikely to have access to the server's configuration, so
drop that. Reword the message to be more consistent with the ones when
the 'is:private' 'is:started' and 'is:wip' operators are not supported.

Change-Id: I93ad6ca19134bb7f80e2e263126419ef14484533
This commit is contained in:
David Pursehouse
2019-12-04 08:36:48 +09:00
parent da5fe12229
commit ea557847da
2 changed files with 2 additions and 2 deletions

View File

@@ -579,7 +579,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData, ChangeQueryBuil
if ("mergeable".equalsIgnoreCase(value)) {
if (!args.indexMergeable) {
throw new QueryParseException("server does not support 'mergeable'. check configs");
throw new QueryParseException("'is:mergeable' operator is not supported by server");
}
return new BooleanPredicate(ChangeField.MERGEABLE);
}

View File

@@ -3093,7 +3093,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
assertThat(thrown.getCause()).isInstanceOf(QueryParseException.class);
assertThat(thrown)
.hasMessageThat()
.contains("server does not support 'mergeable'. check configs");
.contains("'is:mergeable' operator is not supported by server");
}
protected ChangeInserter newChange(TestRepository<Repo> repo) throws Exception {