summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-21 17:03:03 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-21 17:17:38 -0400
commit0f6dae78b45335e0428ed5aba4672b6ad297f82a (patch)
treefc7713a49dbac923169d9b924daeb754a0336658
parentc50ebc8d23916b7f5e35f399936cd4ff5f239c12 (diff)
[bug] avoid choking with some failures
-rw-r--r--src/leap/bitmask/core/dispatcher.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py
index 2d22b57e..11a319fc 100644
--- a/src/leap/bitmask/core/dispatcher.py
+++ b/src/leap/bitmask/core/dispatcher.py
@@ -474,7 +474,11 @@ def _format_error(failure):
# we will not print a full traceback
expected = getattr(failure.value, 'expected', False)
if not expected:
- logger.failure('[DISPATCHER] Unexpected error:')
+ try:
+ logger.failure('[DISPATCHER] Unexpected error:')
+ except:
+ logger.debug('[DISPATCHER] Unexpected error: %r' % failure.value)
+ logger.debug('%r' % failure)
# if needed, we could add here the exception type as an extra field
return json.dumps({'error': failure.value.message, 'result': None})