Error instance is not propagated between action and internal mutation.
Hi, it seems my error instance is not propagated between action and internal mutation.
This only happens in production environment, not in development environment.
Description:
The action triggers internal mutation and internal mutation can throw an ConvexError.
Action (would normally) catches ConvexError and handle it using .data inside.
Do you have any idea to fix this?
9 Replies
This is code that I used to catch error
Hey @daun , in prod you're seeing that the else branch is taken? (this is not clear from the provided screenshots)
I tried to repro but could not repro.
Are you sure the mutation isn't throwing something else than ConvexError in prod? (I'm not sure whether your first screenshot comes from prod logs)
Yes in prod, else branch is taken. After internalMutation raised ConvexError, the error is propagated as ServerError.
Are you on the latest version of Convex? That would be 1.7.1
It's 1.7.1.
Could you share more of your code? I cannot reproduce the issue. You can DM me here on discord.
Thank you, I can reproduce the issue now
We're working on a fix, it won't require changes on your side
Thanks so much!
We're planning to deploy a fix for this tomorrow
This has been fixed, thanks for reporting @daun and apologies for the inconvience caused!
Thanks!