HandleError function in useWriteContract #4460
Unanswered
WingsDevelopment
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I would like to pass handle error function that is going to be called whenever writeContractAsync fails, this would be different from onError because it wouldn't throw error any further. so you won't need to wrap your writeContractAsync inside of a try catch. Or maybe a flag that will prevent an error from being thrown. would something like this make sense ?
Basically here is my wagmi useWriteContract wrapper, and I don't wanna to catch error everytime I use writeContractAsync.
Also I have a question about this code if I am handling error correctly inside of this hook, there is no any unexpected behaviour, correct?
https://github.com/seamless-protocol/seamless-interface/blob/main/src/shared/wagmi-wrapper/hooks/useSeamlessContractWrite.ts
Beta Was this translation helpful? Give feedback.
All reactions