Catch UnprocessableEntityException Currently not caught when creating a branch. From 3.7 it is propagated to the client. Change-Id: I85ea421c24dafa88809ebaad86e1541332957769
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java index 704ae5c..d05eeaa 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java +++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
@@ -33,6 +33,7 @@ import com.google.gerrit.extensions.restapi.BadRequestException; import com.google.gerrit.extensions.restapi.IdString; import com.google.gerrit.extensions.restapi.ResourceConflictException; +import com.google.gerrit.extensions.restapi.UnprocessableEntityException; import com.google.gerrit.server.config.PluginConfigFactory; import com.google.gerrit.server.data.AccountAttribute; import com.google.gerrit.server.data.RefUpdateAttribute; @@ -170,7 +171,8 @@ | ResourceConflictException | IOException | PermissionBackendException - | NoSuchProjectException e) { + | NoSuchProjectException + | UnprocessableEntityException e) { log.error("Failed to create backup ref {}", backupRef, e); } }