summaryrefslogtreecommitdiff
path: root/asciifarm/client/commandhandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'asciifarm/client/commandhandler.py')
-rw-r--r--asciifarm/client/commandhandler.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/asciifarm/client/commandhandler.py b/asciifarm/client/commandhandler.py
index db9f625..ca72b68 100644
--- a/asciifarm/client/commandhandler.py
+++ b/asciifarm/client/commandhandler.py
@@ -51,17 +51,16 @@ class CommandHandler:
}
def execute(self, action):
- try:
- if isinstance(action[0], str):
- command = action[0]
- if command in self.commands:
- self.commands[command](*action[1:])
- else:
- raise InvalidCommandException("Invalid command '{}'".format(command))
+ if action is None:
+ return
+ if isinstance(action[0], str):
+ command = action[0]
+ if command in self.commands:
+ self.commands[command](*action[1:])
else:
- raise Exception("Command should be a string")
- except Exception as e:
- self.log(e)
+ raise InvalidCommandException("Invalid command '{}'".format(command))
+ else:
+ raise Exception("Command should be a string")
# Commands