From 7125a01aa2ff66994ceb2903866e75f8ad4f6cb3 Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Sun, 17 Feb 2013 18:10:20 +0100 Subject: [PATCH] Allow to specify the name for NameAlreadyUsedException The NameAlreadyUsedException's message did not contain any hints to which name was already in use. The additional constructor allows to pass the already used name in order to provide a more meaningful message. Change-Id: If2a26371e3a3fbc9e5212d9347e78d01ba13dd44 --- .../google/gerrit/common/errors/NameAlreadyUsedException.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/errors/NameAlreadyUsedException.java b/gerrit-common/src/main/java/com/google/gerrit/common/errors/NameAlreadyUsedException.java index a2d487bdfc..d3988ff21a 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/errors/NameAlreadyUsedException.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/errors/NameAlreadyUsedException.java @@ -23,4 +23,8 @@ public class NameAlreadyUsedException extends Exception { public NameAlreadyUsedException() { super(MESSAGE); } + + public NameAlreadyUsedException(String name) { + super(MESSAGE + ": " + name); + } }