-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Feature Request: Add reasons for throw statements #355
Comments
This is very hard to impossible given the current framework. Exceptions should be forwarded to higher call stack frames, but the EVM does not provide a way to send any data together with the exception. |
Hmmmmm...is there an EIP for this? There probably should be an EIP for this. |
@chriseth I think I have figured out a way for how to do this. It would require client side interpretation but it is possible to do. If we can unwind the stack trace, there are places where we are more likely to have gotten this error rather than not. We can simply attribute throws/invalid jumps to certain strings based on location of said throw. This can be interpreted by the client based upon where it died. Perhaps sticking "interpretation tags" alongside the binary might provide better error handling when interacting with the chain. |
If you want to do that off-chain, I think it is a much better solution to just use a debugger. |
I just think that there should be more verbose reasons as to why a transaction failed. It gets brought up a lot in our solidity thread (which reminds me I need to link that to the gitter room), and I think it's definitely something we should be addressing. |
I think the interpretation of what an Exception is is exceptional here. In conventional programming languages, an exception does not rollback the state. It is just a way to express that something exceptional happened. If you want to implement such Checked Exceptions, is way more easy and certainly useful. The |
Depends on ethereum/EIPs#140. |
Since |
I think so. The next step of the task is tracked in #1686. |
I'll just close this in favor of that then. |
Someone in the mix room gave this suggestion and I think it's an obvious one. We should be able to create a log with the throw statement that gives a reason for why throw was triggered. Just a string coupled with possibly an expression. What do you think?
The text was updated successfully, but these errors were encountered: