Exception handling in Solidity

chrisethchriseth Member Posts: 170 ✭✭✭
In another thread, the question came up how long it will take to be able to use try/catch. In order not to clutter that other thread, I would like to answer the question here:

Try/catch will probably not be very useful without a change in the EVM, i.e. we will not have this before metropolis.

The problem is that the EVM has only one way to signal "something went wrong" when calling an external function. This will always consume all of the gas available to the function call. As the current strategy (and most of the others are either too complicated or not really useful) is to provide all the gas to the called function, the calling function would have no gas left.
Sign In or Register to comment.