don't throw away unserializable parameter

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
fenn-cs 2021-10-15 00:50:11 +01:00
parent 57a0f76e1f
commit 1a12a8acdf

View File

@ -335,7 +335,12 @@ def log_call_deferred(action_type):
kwargs = {k: bytes_to_unicode(True, kw[k]) for k in kw}
# Remove complex (unserializable) objects from positional args to
# prevent eliot from throwing errors when it attempts serialization
args = tuple([a[pos] for pos in range(len(a)) if is_json_serializable(a[pos])])
args = tuple(
a[pos]
if is_json_serializable(a[pos])
else str(a[pos])
for pos in range(len(a))
)
with start_action(action_type=action_type, args=args, kwargs=kwargs).context():
# Use addActionFinish so that the action finishes when the
# Deferred fires.