rudimentary user input error handling

This commit is contained in:
poweronoff 2017-04-22 16:15:32 +02:00
parent 737d4a61ca
commit de00d0cff3

View File

@ -29,7 +29,12 @@ public class LoopingConsole {
while (true) {
System.out.print("> ");
String input = br.readLine();
robotEngine.commandBot(createCommand(input));
try {
robotEngine.commandBot(createCommand(input));
}catch (InvalidUserInputException e) {
System.out.println("\nInput error occurred! Message: " + e.getMessage() +"\n");
printUsageBanner();
}
if (input.trim().toLowerCase().equals(EXIT_COMMAND)) {
System.out.println("exiting");