NIFI-1282 This closes #228. Fixed error message when attempting to start a disabled port

Fixed error message when attempting to start a disabled port

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Pierre Villard 2016-02-16 14:34:40 +01:00 committed by joewitt
parent cae5b109c0
commit ef0018cf66
1 changed files with 7 additions and 2 deletions

View File

@ -539,8 +539,13 @@ public abstract class AbstractPort implements Port {
public void verifyCanStart() {
readLock.lock();
try {
if (scheduledState.get() != ScheduledState.STOPPED) {
throw new IllegalStateException(this + " is not stopped");
switch (scheduledState.get()) {
case DISABLED:
throw new IllegalStateException(this + " cannot be started because it is disabled");
case RUNNING:
throw new IllegalStateException(this + " cannot be started because it is already running");
case STOPPED:
break;
}
verifyNoActiveThreads();