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

Improve exception logging of unobserved exceptions via FireAndForget #27077

Merged
merged 1 commit into from Feb 10, 2024

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Feb 7, 2024

Coming from #27076, where the log output makes finding where the exception arrived for nigh impossible.

Example output:

2024-02-07 16:23:25 [error]: Unobserved exception via FireAndForget: Test
2024-02-07 16:23:25 [error]: System.InvalidOperationException: Test
2024-02-07 16:23:25 [error]: at osu.Game.Graphics.ScreenshotManager.<TakeScreenshotAsync>b__25_0() in /Users/dean/Projects/osu/osu.Game/Graphics/ScreenshotManager.cs:line 88
2024-02-07 16:23:25 [error]: at System.Threading.Tasks.Task`1.InnerInvoke()
2024-02-07 16:23:25 [error]: at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
2024-02-07 16:23:25 [error]: --- End of stack trace from previous location ---
2024-02-07 16:23:25 [error]: at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
2024-02-07 16:23:25 [error]: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
2024-02-07 16:23:26 [debug]: Pressed (HoldForHUD) handled by HUDOverlay.
2024-02-07 16:23:26 [debug]: KeyDownEvent(ControlLeft, False) handled by GlobalActionContainer.
2024-02-07 16:23:26 [debug]: Pressed (Back) handled by HoldForMenuButton+HoldButton.
2024-02-07 16:23:26 [debug]: KeyDownEvent(Escape, False) handled by GlobalActionContainer.
2024-02-07 16:23:26 [debug]: Pressed (HoldForHUD) handled by HUDOverlay.
2024-02-07 16:23:26 [debug]: KeyDownEvent(ControlLeft, False) handled by GlobalActionContainer.
2024-02-07 16:23:26 [debug]: Pressed (Back) handled by HoldForMenuButton+HoldButton.
2024-02-07 16:23:26 [debug]: KeyDownEvent(Escape, False) handled by GlobalActionContainer.
2024-02-07 16:23:26 [debug]: Pressed (Back) handled by HoldForMenuButton+HoldButton.
2024-02-07 16:23:26 [debug]: KeyDownEvent(Escape, False) handled by GlobalActionContainer.
2024-02-07 16:23:27 [verbose]: ⚠️ Unobserved exception via FireAndForget: Test

Coming from ppy#27076, where the log
output makes finding where the exception arrived for nigh impossible.
@bdach bdach merged commit 4a516cb into ppy:master Feb 10, 2024
15 of 17 checks passed
@peppy peppy deleted the log-fire-and-forget-better branch February 15, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants