Adding simple script command. Improving run exception.
Adding a simple script command implementation in ScriptExecution The CommandRunException now embeds a type for usage, interaction or running and the source
This commit is contained in:
@@ -36,7 +36,6 @@ package fr.bigeon.gclc;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import fr.bigeon.gclc.ConsoleApplication;
|
||||
import fr.bigeon.gclc.command.Command;
|
||||
import fr.bigeon.gclc.command.ExitCommand;
|
||||
import fr.bigeon.gclc.command.HelpExecutor;
|
||||
@@ -74,7 +73,8 @@ public class ConsoleTestApplication extends ConsoleApplication {
|
||||
try {
|
||||
manager.println("Test command ran fine");
|
||||
} catch (IOException e) {
|
||||
throw new CommandRunException("manager closed", e);
|
||||
throw new CommandRunException("manager closed", e,
|
||||
this);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -92,9 +92,11 @@ public class ConsoleTestApplication extends ConsoleApplication {
|
||||
Thread.sleep(TWO_SECONDS);
|
||||
manager.println("done!");
|
||||
} catch (IOException e) {
|
||||
throw new CommandRunException("manager closed", e);
|
||||
throw new CommandRunException("manager closed", e,
|
||||
this);
|
||||
} catch (InterruptedException e) {
|
||||
throw new CommandRunException("wait interrupted", e);
|
||||
throw new CommandRunException("wait interrupted", e,
|
||||
this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user