Background
Chromium.errorCallback logs and then calls os.Exit(1). That is appropriate while the WebView2 environment/controller is being created (the app cannot function without it), but chromium.go routes runtime COM errors through the same path — so any transient failure after startup kills the whole application.
This single pattern has now caused three independent crash reports, each fixed individually on the #5568 branch:
Audit of the remaining runtime sites (31 total errorCallback calls)
Defensibly fatal — init path (~20 sites): Embed, environment/controller creation callbacks, controller setup (lines ~172–392). No change proposed.
Disproportionate — runtime paths (~11 sites):
| Method |
Failure consequence today |
Proposed |
Resize/GetClientRect |
exit during teardown/DPI churn |
log + skip frame |
Navigate / NavigateToString |
exit |
return/log error |
Init (AddScriptToExecuteOnDocumentCreated) |
exit |
log |
MessageReceived → TryGetWebMessageAsString |
a malformed message kills the app |
log + drop message |
SetBackgroundColour |
exit |
log |
PermissionRequested (GetPermissionKind/PutState) |
exit |
log + default-deny |
AddWebResourceRequestedFilter |
exit |
log |
PutZoomFactor |
exit |
log |
Proposed direction
Once #5568 lands (which establishes the pattern for Focus/Eval), convert the remaining runtime sites to non-fatal logging in a follow-up PR, keeping fatal behaviour only for the init path. Each conversion is mechanical; the audit above is the work list.
Filed from the triage loop so the work list isn't lost — the per-site line numbers are current as of master @ alpha.99.
Background
Chromium.errorCallbacklogs and then callsos.Exit(1). That is appropriate while the WebView2 environment/controller is being created (the app cannot function without it), butchromium.goroutes runtime COM errors through the same path — so any transient failure after startup kills the whole application.This single pattern has now caused three independent crash reports, each fixed individually on the #5568 branch:
Focus()during controller init →E_INVALIDARG→ exit (startup race)Focus()on a tray-minimised window →E_INVALIDARG→ exit (100% reproducible)Eval()during a mixed-DPI monitor-crossing drag →RESOURCE_NOT_IN_CORRECT_STATE→ exitAudit of the remaining runtime sites (31 total
errorCallbackcalls)Defensibly fatal — init path (~20 sites):
Embed, environment/controller creation callbacks, controller setup (lines ~172–392). No change proposed.Disproportionate — runtime paths (~11 sites):
Resize/GetClientRectNavigate/NavigateToStringInit(AddScriptToExecuteOnDocumentCreated)MessageReceived→TryGetWebMessageAsStringSetBackgroundColourPermissionRequested(GetPermissionKind/PutState)AddWebResourceRequestedFilterPutZoomFactorProposed direction
Once #5568 lands (which establishes the pattern for
Focus/Eval), convert the remaining runtime sites to non-fatal logging in a follow-up PR, keeping fatal behaviour only for the init path. Each conversion is mechanical; the audit above is the work list.Filed from the triage loop so the work list isn't lost — the per-site line numbers are current as of master @ alpha.99.