Fix generic handling of NameAlreadyUsedException in GerritCallback

GerritCallback identifies a NameAlreadyUsedException by checking the
exception message. Since commit 7125a01aa2
the exception message may now include the already used name. Because of
this the check in GerritCallback must be adapted. Make sure that the
already used name is included into the displayed error message.

Change-Id: I27813bca41c6218e7f6ce740b43a8d596c8763b5
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-02-19 08:08:25 +01:00
parent 9e56ab322f
commit a041fc8889
6 changed files with 8 additions and 10 deletions

View File

@@ -18,13 +18,9 @@ package com.google.gerrit.common.errors;
public class NameAlreadyUsedException extends Exception {
private static final long serialVersionUID = 1L;
public static final String MESSAGE = "Name Already Used";
public NameAlreadyUsedException() {
super(MESSAGE);
}
public static final String MESSAGE = "Name Already Used: ";
public NameAlreadyUsedException(String name) {
super(MESSAGE + ": " + name);
super(MESSAGE + name);
}
}