Skip to content
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

Closed
VoR0220 opened this issue Jan 15, 2016 · 10 comments
Closed

Feature Request: Add reasons for throw statements #355

VoR0220 opened this issue Jan 15, 2016 · 10 comments

Comments

@VoR0220
Copy link
Member

VoR0220 commented Jan 15, 2016

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?

@chriseth
Copy link
Contributor

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.

@VoR0220
Copy link
Member Author

VoR0220 commented Jan 15, 2016

Hmmmmm...is there an EIP for this? There probably should be an EIP for this.

@chriseth chriseth added this to the 99-nice-but-how milestone Aug 5, 2016
@VoR0220
Copy link
Member Author

VoR0220 commented Nov 28, 2016

@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.

@chriseth
Copy link
Contributor

If you want to do that off-chain, I think it is a much better solution to just use a debugger.

@VoR0220
Copy link
Member Author

VoR0220 commented Nov 29, 2016

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.

@rolandkofler
Copy link

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 throw statement then should remain or better renamed, e.g. throw rollback;

@axic
Copy link
Member

axic commented Feb 6, 2017

Depends on ethereum/EIPs#140.

@chriseth chriseth removed this from the 99-nice-but-how milestone Mar 3, 2017
@axic axic added feature and removed enhancement labels Sep 14, 2017
@VoR0220
Copy link
Member Author

VoR0220 commented Oct 11, 2017

Since revert has been added...is this safe to close?

@axic
Copy link
Member

axic commented Oct 11, 2017

I think so. The next step of the task is tracked in #1686.

@VoR0220
Copy link
Member Author

VoR0220 commented Oct 11, 2017

I'll just close this in favor of that then.

@VoR0220 VoR0220 closed this as completed Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants