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

HybridWebView needs a consistent and usable story for handling JS methods that throw exceptions #27097

Open
mattleibow opened this issue Jan 13, 2025 · 1 comment · May be fixed by #27129
Open
Assignees
Labels
area-controls-hybridwebview HybridWebView control s/triaged Issue has been reviewed t/enhancement ☀️ New feature or request
Milestone

Comments

@mattleibow
Copy link
Member

Description

Right now HybridWebView invocation of JS methods can hide exceptions thrown by the user code. At an absolute minimum this needs to be logged via .NET MAUI's loggers and/or the webview loggers (JS console.log(), etc.). But some of these exceptions should likely bubble up to the caller in an appropriate manner.

For example if C# calls JS code and the JS code fails, then that JS failure should be bubbled back up to the C# caller as a .NET exception so that it can be caught/handled in a try-catch.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.21 SR2.1

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

No response

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@mattleibow mattleibow added the area-controls-hybridwebview HybridWebView control label Jan 13, 2025
@mattleibow mattleibow added this to the .NET 10 Planning milestone Jan 13, 2025
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@dotnet-policy-service dotnet-policy-service bot added the s/triaged Issue has been reviewed label Jan 13, 2025
@mattleibow mattleibow added the t/enhancement ☀️ New feature or request label Jan 13, 2025
@mattleibow mattleibow moved this from Todo to In Progress in MAUI SDK Ongoing Jan 14, 2025
@mattleibow mattleibow self-assigned this Jan 14, 2025
@mattleibow mattleibow linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-hybridwebview HybridWebView control s/triaged Issue has been reviewed t/enhancement ☀️ New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant