Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions azure/functions/durable_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def decode(cls,
except json.JSONDecodeError:
# String failover if the content is not json serializable
result = data.value
except Exception:
except Exception as e:
raise ValueError(
'activity trigger input must be a string or a '
f'valid json serializable ({data.value})')
f'valid json serializable ({data.value})') from e
else:
raise NotImplementedError(
f'unsupported activity trigger payload type: {data_type}')
Expand All @@ -115,9 +115,9 @@ def encode(cls, obj: typing.Any, *,
try:
callback = _durable_functions._serialize_custom_object
result = json.dumps(obj, default=callback)
except TypeError:
except TypeError as e:
raise ValueError(
f'activity trigger output must be json serializable ({obj})')
f'activity trigger output must be json serializable ({obj})') from e

return meta.Datum(type='json', value=result)

Expand Down
Loading