-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
estimateTransactionGasLimit
hides errors from the caller
#1080
Comments
We realized that the useContractFunction |
@shioju , I'm experiencing a similar issue - however the They cannot confirm the TX as the gas estimate is See the error below:
I need some way to access the error so that I can parse it using the interface, but it never reaches the dapp state. |
Describe the bug
estimateTransactionGasLimit
hides errors from the callerTo Reproduce
We're using
useContractFunction
to call a smart contract function. In this instance, we're expecting the function to revert with a custom error, and want to catch it and display an appropriate error message to the user.However, we only see the
![screenshot-20230208-12:34:23](https://user-images.githubusercontent.com/4652591/217434615-adda0dc9-3f7a-494d-a1ce-2979dd89dc92.png)
cannot estimate gas
error in the browser console, but unable to catch the error where we're callingsend
.Relevant part of
![screenshot-20230208-12:26:02](https://user-images.githubusercontent.com/4652591/217434803-5385d1ca-50bd-4626-9f80-d1e093874f94.png)
useContractFunction
'ssend
which checks gas estimate:Relevant part of
![screenshot-20230208-12:39:34](https://user-images.githubusercontent.com/4652591/217435133-1883cbe6-f538-4205-8ad0-17c2b32ff1b6.png)
estimateTransactionGasLimit
which catches the error but does not throw it to the caller:The text was updated successfully, but these errors were encountered: