Inject logs into module on failure to invoke reducer #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Addresses https://www.notion.so/clockworklabs/Print-in-module-logs-when-calling-a-reducer-with-wrong-arguments-8a25d6dd90be443d92d848bbca7c1862
Took me a few days to figure out the plumbing, but once I got it it was quite simple.
This produces logs like so:
Side comments
While testing, I was using a small generated Rust client module. Should I check that in as a test? I noticed there aren't currently any generated Rust clients in test/, not sure if we're keeping that out of the test surface for now.
I also noticed that the Rust client SDK mostly silently swallows errors. E.g. a reducer called from out-of-date generated client code doesn't produce an error, also attempting to iterate a table with an out-of-date generated schema silently fails and iterates nothing. There is a little bit of stuff in the logs though if you configure a logger. I guess I should create separate issues for these problems?