Context shouldn't be dumped as json in case of exceptions - if some objects are not JSON serializable then we end up with an uncaught exception

This commit is contained in:
Fabio Manganiello 2021-03-05 18:52:57 +01:00
parent 47ba13d985
commit 04ff008800

View file

@ -133,7 +133,7 @@ class Request(Message):
exec('{}="{}"'.format(k, re.sub(r'(^|[^\\])"', '\1\\"', v)))
except Exception as e:
logger.warning('Could not set context variable {}={}'.format(k, v))
logger.warning('Context: {}'.format(json.dumps(context)))
logger.warning('Context: {}'.format(context))
logger.exception(e)
parsed_value = ''