Skip to content

Guard async void TaskViewModel methods against unhandled exceptions#401

Merged
Shivansps merged 1 commit into
KnossosNET:mainfrom
Goober5000:fix/h14
May 9, 2026
Merged

Guard async void TaskViewModel methods against unhandled exceptions#401
Shivansps merged 1 commit into
KnossosNET:mainfrom
Goober5000:fix/h14

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

InstallMod, VerifyMod, CreateModVersion, and UploadModVersion were async void with no top-level exception handling. Any exception escaping after an await would be posted to the SynchronizationContext as unhandled, silently crashing the process — no global handler is registered anywhere in the codebase.

Wrap each method body in a try/catch that logs via Log.Add, matching the pattern already used in Knossos.StartUp and Knossos.PlayMod. No callers need to change; the fire-and-forget pattern is preserved.

InstallMod, VerifyMod, CreateModVersion, and UploadModVersion were
async void with no top-level exception handling. Any exception escaping
after an await would be posted to the SynchronizationContext as
unhandled, silently crashing the process — no global handler is
registered anywhere in the codebase.

Wrap each method body in a try/catch that logs via Log.Add, matching
the pattern already used in Knossos.StartUp and Knossos.PlayMod.
No callers need to change; the fire-and-forget pattern is preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wookieejedi

Copy link
Copy Markdown
Contributor

Things still work as expected

@Shivansps Shivansps merged commit c50528d into KnossosNET:main May 9, 2026
@Goober5000 Goober5000 deleted the fix/h14 branch May 9, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants