-
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
Fix: specify log exception. #3089
Conversation
} | ||
catch | ||
{ | ||
throw new ArgumentException("Failed to convert byte array to string: Invalid or non-printable UTF-8 sequence detected.", nameof(state)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the failed data in hex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, cause user passes in bytes, if you show them hex, does that help at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the message, both options are good for me
…to specify-log-exception * 'specify-log-exception' of github.com:Liaojinghui/neo: Update: list all existing pligins when checking plugin list, not just installed (neo-project#3080)
@@ -458,6 +458,7 @@ public virtual VerifyResult VerifyStateIndependent(ProtocolSettings settings) | |||
|
|||
public StackItem ToStackItem(ReferenceCounter referenceCounter) | |||
{ | |||
if (_signers == null || _signers.Length == 0) throw new ArgumentException("Sender is not specified in the transaction."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change fork something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it will still fault. Originally it fault, now it still fault, but fault with different exception, a more reasonable exception message.
Description
The RuntimeLog interface failed to speficy the exception message, though it takes arbitrary byte array as parameter, it only accept UTF8 sequence.
Fixes # (issue) #3088
Type of change
How Has This Been Tested?
Test Configuration:
Run TestInvalidUtf8LogMessage in UT_ApplicationEngine.Runtime.cs
Checklist: