summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/dispatcher.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py
index 363594ca..91168d87 100644
--- a/src/leap/bitmask/core/dispatcher.py
+++ b/src/leap/bitmask/core/dispatcher.py
@@ -186,8 +186,8 @@ class VPNCmd(SubCommand):
@register_method('dict')
def do_STATUS(self, vpn, *parts):
- d = vpn.do_status()
- return d
+ result = vpn.do_status()
+ return result
@register_method('dict')
def do_START(self, vpn, *parts):
@@ -570,7 +570,11 @@ class CommandDispatcher(object):
def _format_result(result):
- return json.dumps({'error': None, 'result': result})
+ if isinstance(result, dict) and result.get('error'):
+ error = result['error']
+ else:
+ error = None
+ return json.dumps({'error': error, 'result': result})
def _format_error(failure):