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
This commit is contained in:
Christian Aistleitner 2013-02-17 18:10:20 +01:00 committed by Bruce Zu
parent 55364017da
commit 7125a01aa2

View File

@ -23,4 +23,8 @@ public class NameAlreadyUsedException extends Exception {
public NameAlreadyUsedException() {
super(MESSAGE);
}
public NameAlreadyUsedException(String name) {
super(MESSAGE + ": " + name);
}
}