Support multiple TRACE_ID in SharedRefDbExceptionHook Adapt the SharedRefDbExceptionHook to the ExceptionHook signature amended with Iebfc5301a2ad. Change-Id: I0f20d070dda5a140a27da15d8b8e5685236c2ad9
diff --git a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbExceptionHook.java b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbExceptionHook.java index a7f2740..e0495d5 100644 --- a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbExceptionHook.java +++ b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbExceptionHook.java
@@ -16,7 +16,7 @@ import com.gerritforge.gerrit.globalrefdb.GlobalRefDbLockException; import com.google.common.collect.ImmutableList; -import com.google.gerrit.common.Nullable; +import com.google.common.collect.ImmutableSet; import com.google.gerrit.server.ExceptionHook; import java.util.Optional; @@ -36,12 +36,14 @@ } @Override - public ImmutableList<String> getUserMessages(Throwable throwable, @Nullable String traceId) { + public ImmutableList<String> getUserMessages(Throwable throwable, ImmutableSet<String> traceIds) { if (throwable instanceof GlobalRefDbLockException) { ImmutableList.Builder<String> builder = new ImmutableList.Builder<>(); builder.add(throwable.getMessage()); - if (traceId != null && !traceId.isBlank()) { - builder.add(String.format("Trace ID: %s", traceId)); + for (String traceId : traceIds) { + if (traceId != null && !traceId.isBlank()) { + builder.add(String.format("Trace ID: %s", traceId)); + } } return builder.build(); }