Skip to content

Catching custom errors #3291

Answered by ricmoo
Mudloop asked this question in Q&A
Aug 18, 2022 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

That is a gas estimation error, which means the transaction is not calling a constant method. Only methods called using call can receive custom errors. If you would like to preflight a state-mutating method, you can use the contract.callStatic.METHOD_NAME(params) which will force using call, which on error will throw the custom error.

Let me know if that works. :)

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@Mudloop
Comment options

@ricmoo
Comment options

@Mudloop
Comment options

@ricmoo
Comment options

@Mudloop
Comment options

Answer selected by Mudloop
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants