Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix crash when event does not haveAdd method and improve message for some other internal errors#2409

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
filmor merged 3 commits intopythonnet:masterfromlosttech:InternalError
Jul 2, 2024

Conversation

lostmsu
Copy link
Member

What does this implement/fix? Explain your changes.

  1. Fixes crash on events with noAddMethod
  2. AddsInternalPythonnetException that can tell user what .NET type caused failure if an unexpected internal error occurs

Does this close any currently open issues?

#2405

Checklist

Check all those that are applicable and complete.

@filmor
Copy link
Member

As said, while looking mildly prettier, this still renders the library completely useless in this case. I don't think there is any valid reason for us to bail out on init just because a single type is not loaded properly.

So, sure, we can merge this, but we can not claim that it fixes the reported issue.

@lostmsu
Copy link
MemberAuthor

lostmsu commentedJul 2, 2024
edited
Loading

@filmor the fix is the new null check inShouldBindEvent.

The rest is to make it easier to do bug reports: the error data will now at least contain the name of the type that we failed to process.

@filmor
Copy link
Member

I see. Still don't see why makingShouldBindEvent special in that it swallows the error instead of throwing is better than just behaving like this uniformly. I'd rather have none of these functions throw, but at least it fixes the reported issue.

@filmorfilmor merged commit9ebfbde intopythonnet:masterJul 2, 2024
27 checks passed
@lostmsu
Copy link
MemberAuthor

@filmor it does not swallow the error.

The checks on methods and fields are different. They actually check that method or field was passed, and not justnull. In case of event the event itself must exist as well (e.g. not null), but some events apparently do not have a corresponding add method for handlers:AddMethod property is nullable

BTW I was unable to reproduce it with C#.

@lostmsulostmsu deleted the InternalError branchJuly 2, 2024 22:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor approved these changes

Assignees

@filmorfilmor

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@lostmsu@filmor

[8]ページ先頭

©2009-2025 Movatter.jp