-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Enhance Exception Handling for Improved Clarity and Debugging #3536
Comments
Please never mix these. In general VM exception is VM failure (I know we have I think what you're mostly referring to here is VM-level things. And I can't see any problem with it now. It just fails, except in case of |
nothing will be changed, exception will still be exception, just trying to.make the name more meaningful and enforce a detailed error message. its an issue purely for c# implementation, not protocol level. |
If possible, could the VM print some info of each context in the InvocationStack? |
I think we can make the error message standard, do you mind to provide a template? @Hecate2 |
https://github.com/Hecate2/neo-fairy-test/blob/master/Fairy.Tester.cs#L153-L153 I wrote codes for this, but do we really need a standard for errors? Different languages may prefer different implememtations. |
This is for C# itself. |
Summary or problem description
The current exception handling in Neo VM and Contract lacks clarity and detailed information. While there are various exception types, they often fail to provide useful details about why a transaction fails. Additionally, it's not immediately clear to developers which exceptions can be caught by the VM and which cannot.
Do you have any solution you want to propose?
We propose to enhance the exception system with the following changes:
For example, instead of throwing an InvalidOperationException without a message, we would throw a VMUncatchableInvalidOperationException with a detailed description like: "Invalid operation: Attempt to divide by zero at instruction DIV with value 10".
This change will:
AND, we can also just maintain two exceptions: vmcachable and vmuncatchable exceptions.
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: