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:
2016-06-12 15:46:18 -04:00
parent 095a363520
commit 3c1c8e85c8
11 changed files with 202 additions and 116 deletions

View File

@@ -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);
}
}
});