Skip to content

Conversation

andystaples
Copy link

Currently if to_json fails, we discard the original failure and raise our own ValueError - this PR makes the new exception inherit from the original exception, making debugging serialization issues easier.

@andystaples andystaples changed the title Improve JSON conversion logging errors in Durable feat: improve JSON error logging for Durable Sep 12, 2025
@hallvictoria
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you add a unit test for this in tests/test_durable_functions.py?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - let me know if you need to see more cases - I figured as long as the error was there in one case, that was sufficient

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - this change can be part of v1.25.0. We're looking to release 1.25.0b1 by end of October - lmk if there's any concerns over timelines!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@hallvictoria
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants