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

Callbacks into Toga invoked from .NET do not respect failure modes #2779

Closed
rmartin16 opened this issue Aug 19, 2024 · 1 comment · Fixed by #2781
Closed

Callbacks into Toga invoked from .NET do not respect failure modes #2779

rmartin16 opened this issue Aug 19, 2024 · 1 comment · Fixed by #2781
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@rmartin16
Copy link
Member

Describe the bug

While investigating #2752, I discovered that the RuntimeError being raised because the WebView failed to initialize was swallowed and suppressed. Even running sys.exit(1) did not cause a visible error to be raised.

As such, developers and end-users are not informed of critical runtime errors.

Steps to reproduce

It's probably easiest to just force it; that is, just update winforms_initialization_completed to always raise an Exception and run an app using the WebView.

Expected behavior

Errors detected in such callbacks are reported to users.

Screenshots

No response

Environment

  • Operating System: Windows 11
  • Python version: 3.12
  • Software versions:
    • Briefcase: 0.3.20.dev96+g23d1ed34
    • Toga: 0.4.6.dev321+g79719fce4

Logs

briefcase.2024_08_19-16_36_06.dev.log

Additional context

No response

@rmartin16 rmartin16 added bug A crash or error in behavior. windows The issue relates to Microsoft Windows support. labels Aug 19, 2024
@freakboy3742
Copy link
Member

As a workaround, would it make sense to actually write the error message to the console, in addition to raising the RuntimeError and assuming it will be seen/surfaced? I agree this would be less than ideal, but it would be better to output something that indicates there's a problem rather than fail silently when we know there's been a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants