-
-
Notifications
You must be signed in to change notification settings - Fork 453
Fix unhandled external plugin's TaskSchedulerUnobservedTaskException by silently logging and not show exception message box #3627
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
🥷 Code experts: Yusyuriv Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 Walkthrough""" WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant ErrorReporting
participant ReportWindow
App->>ErrorReporting: Report(exception, silent)
alt silent == false
ErrorReporting->>ReportWindow: Show(exception)
else silent == true
ErrorReporting-->>ReportWindow: (No UI shown)
end
ErrorReporting->>App: Log exception
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
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.
Pull Request Overview
This PR changes unobserved task exception handling to log errors silently instead of showing a UI dialog.
- Added a
silentflag toReportto suppress the error window - Modified
TaskSchedulerUnobservedTaskExceptionto useLog.Exceptionand skip the dispatcher call
Comments suppressed due to low confidence (3)
Flow.Launcher/Helper/ErrorReporting.cs:14
- Add XML doc comments describing the new
silentparameter so maintainers understand its purpose and default behavior.
private static void Report(Exception e, bool silent = false, [CallerMemberName] string methodName = "UnHandledException")
Flow.Launcher/Helper/ErrorReporting.cs:14
- [nitpick] The
silentparameter could be more descriptive (e.g.,suppressDialog) to clarify that it prevents the error UI from appearing.
private static void Report(Exception e, bool silent = false, [CallerMemberName] string methodName = "UnHandledException")
Flow.Launcher/Helper/ErrorReporting.cs:41
- Consider adding a unit or integration test to verify that the handler logs the exception and does not show a window when the
silentflag is used.
Log.Exception(nameof(ErrorReporting), "Unobserved task exception occurred.", e.Exception);
Since many plugins do not follow strict coding rules and they do not handle exception in async void functions, we should just log the exception and do not open exception message box.
Resolve #3619, #3622, #3628.