5

Is there any built-in way of catching throw clauses?

For example, if I'm building a voting application where people must be given permission by the chairperson before voting, otherwise the contract throws.

Would it be possible to catch this throw in order to give the user a feedback of what happened without having to manually trigger an event?

3

No. Throw generates an invalid JUMP in the EVM causing immediate termination.

If you're building your own DApp, simply check for voting rights before trying to vote. It's simpler than handling exceptional cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.