Replies: 4 comments 3 replies
-
Thanks for this issue! Definitely agree it would be nice to have a way to extract the error of a contract read when The way I'd say this issue is more of a feature request than a bug, so I am going to move this to a discussion under "Ideas" & I'll add it to the wagmi roadmap. |
Beta Was this translation helpful? Give feedback.
-
The returned error per read shows in the console when |
Beta Was this translation helpful? Give feedback.
-
Can the return value be the object or an javascript That way you can iterate the response and handle the Error objects as needed. Multicall3 supports this in the return value. We recently ran into this with a front-end. |
Beta Was this translation helpful? Give feedback.
-
Why is allowFailure on reads but not read (singular)? Is there a more appropriate way to suppress a particular common contract reversion? |
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Package Version
0.6.7
Current Behavior
Hello,
I've tried adding an
onError
to each read ofuseContractReads
, but I don't believe the feature exists.Is there a way to retrieve the error from each read, instead of aborting and only getting the first error returned?
Thank you 🤝
Expected Behavior
useContractreads
only will useonError
ifallowFailure: false
and aborts all of the reads upon a single error. I need the reads to happen for each call passed in, and return an error for each call that happens if it exists.Steps To Reproduce
For example:
It currently forces use of
allowFailure
, will stop calling the reads after the first error is thrown, and only show said first error:Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions