You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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