rudimentary user input error handling
This commit is contained in:
parent
737d4a61ca
commit
de00d0cff3
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user