Merge branch 'stable-3.7'

* stable-3.7:
  Return BAD_REQUEST when the REST API throws IllegalArgumentException

Change-Id: I20f022beaaa0db32837d6da6f643675f2f416fe5
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/PullReplicationFilter.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/PullReplicationFilter.java
index 20122a7..7027239 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/PullReplicationFilter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/PullReplicationFilter.java
@@ -140,7 +140,7 @@
     } catch (AuthException e) {
       RestApiServlet.replyError(
           httpRequest, httpResponse, SC_FORBIDDEN, e.getMessage(), e.caching(), e);
-    } catch (MalformedJsonException | JsonParseException e) {
+    } catch (MalformedJsonException | JsonParseException | IllegalArgumentException e) {
       logger.atFine().withCause(e).log("REST call failed on JSON parsing");
       RestApiServlet.replyError(
           httpRequest, httpResponse, SC_BAD_REQUEST, "Invalid json in request", e);