-
Notifications
You must be signed in to change notification settings - Fork 748
Better error messages for method argument mismatch and others #1361
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
lostmsu
reviewed
Jan 21, 2021
lostmsu
reviewed
Jan 21, 2021
lostmsu
requested changes
Jan 21, 2021
… value conversion, and other problems Converter.ToManaged obeys setError consistently PyObject_Hash and tp_hash return nint MakeGenericType and MakeGenericMethod have try/catch RaiseTypeError sets __cause__ instead of changing the message string
98b4ef5
to
716c98d
Compare
lostmsu
requested changes
Jan 22, 2021
AggregateExceptions print better from Python For an overloaded method, MethodBinder.Bind collects all binding errors
lostmsu
reviewed
Jan 26, 2021
lostmsu
reviewed
Jan 26, 2021
lostmsu
requested changes
Jan 26, 2021
…eption.Message (for justification see https://stackoverflow.com/questions/2176707/exception-message-vs-exception-tostring ) Binding failures always have AggregateException as the cause, with PythonExceptions as the inner.inner exceptions.
lostmsu
approved these changes
Jan 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
This change produces more specific error messages by passing setError=true to Converter.ToManaged whenever possible, such as when there is only one method in methodbinder. To support this:
Does this close any currently open issues?
No, but it provides more information to the user when they come across issues like #1099 . Instead of "No method matches" or "No match found" it now says
TypeError : 'int' value cannot be converted to System.Enum
Any other comments?
I added some failing test cases to test_array.py that should be addressed by a future PR.
Checklist
Check all those that are applicable and complete.
AUTHORS
CHANGELOG