summaryrefslogtreecommitdiffstats
path: root/module/remote/wsbackend/ApiHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/remote/wsbackend/ApiHandler.py')
-rw-r--r--module/remote/wsbackend/ApiHandler.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/remote/wsbackend/ApiHandler.py b/module/remote/wsbackend/ApiHandler.py
index 52dd05b9f..eec546d47 100644
--- a/module/remote/wsbackend/ApiHandler.py
+++ b/module/remote/wsbackend/ApiHandler.py
@@ -18,6 +18,8 @@
from mod_pywebsocket.msgutil import receive_message
+from module.Api import ExceptionObject
+
from AbstractHandler import AbstractHandler
class ApiHandler(AbstractHandler):
@@ -50,7 +52,7 @@ class ApiHandler(AbstractHandler):
func, args, kwargs = self.handle_call(msg, req)
if not func:
- return # Result was already sent
+ return # handle_call already sent the result
if func == 'login':
user = self.api.checkAuth(*args, **kwargs)
@@ -74,6 +76,8 @@ class ApiHandler(AbstractHandler):
try:
result = getattr(req.api, func)(*args, **kwargs)
+ except ExceptionObject, e:
+ return self.send_result(req, self.BAD_REQUEST, e)
except AttributeError:
return self.send_result(req, self.NOT_FOUND, "Not Found")
except Exception, e: