diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-11 00:32:50 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-11 00:32:50 +0200 |
commit | 031632245e147e4532b252f91e31631570aa0fd3 (patch) | |
tree | 181833f353f7bbcf68a629bf323deba026d2d200 /voctocore/lib/controlserver.py | |
parent | 10058b623dee99ed54421ff204b51adcc9a379d0 (diff) |
a rudimentary audio pipeline
Diffstat (limited to 'voctocore/lib/controlserver.py')
-rw-r--r-- | voctocore/lib/controlserver.py | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/voctocore/lib/controlserver.py b/voctocore/lib/controlserver.py index 2b96152..79aa617 100644 --- a/voctocore/lib/controlserver.py +++ b/voctocore/lib/controlserver.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -import socket, logging +import socket, logging, traceback from gi.repository import GObject from lib.commands import ControlServerCommands @@ -90,15 +90,23 @@ class ControlServer(): return False, 'unknown command %s' % command - # fetch the function-pointer - f = getattr(self.commands, command) + try: + # fetch the function-pointer + f = getattr(self.commands, command) - # call the function - ret = f(*args) + # call the function + ret = f(*args) - # if it returned an iterable, probably (Success, Message), pass that on - if hasattr(ret, '__iter__'): - return ret - else: - # otherwise construct a tuple - return (ret, None) + # if it returned an iterable, probably (Success, Message), pass that on + if hasattr(ret, '__iter__'): + return ret + else: + # otherwise construct a tuple + return (ret, None) + + except Exception as e: + self.log.error("Trapped Exception in Remote-Communication: %s", e) + traceback.print_exc() + + # In case of an Exception, return that + return False, str(e) |