MCPcopy Create free account
hub / github.com/contextgo/contextgo / promptMainWindowLoadFailure

Function promptMainWindowLoadFailure

src/process/utils/mainWindowLifecycle.ts:168–203  ·  view source on GitHub ↗
(
  window: BrowserWindow,
  details: {
    errorCode: number;
    errorDescription: string;
    validatedURL: string;
    isMainFrame: boolean;
  }
)

Source from the content-addressed store, hash-verified

166};
167
168export const promptMainWindowLoadFailure = (
169 window: BrowserWindow,
170 details: {
171 errorCode: number;
172 errorDescription: string;
173 validatedURL: string;
174 isMainFrame: boolean;
175 }
176): Promise<MainWindowRecoveryAction | null> => {
177 if (!details.isMainFrame || details.errorCode === -3) {
178 return Promise.resolve(null);
179 }
180
181 return showRecoveryDialog({
182 window,
183 titleKey: 'common.rendererCrash.windowLoadFailedTitle',
184 titleDefaultValue: 'Renderer failed to load',
185 messageKey: 'common.rendererCrash.windowLoadFailedDescription',
186 messageDefaultValue: 'The main window failed to load. Retry the renderer to recover the application shell.',
187 detail: formatRecoveryDetail(details),
188 buttons: [
189 {
190 action: 'wait',
191 labelKey: 'common.wait',
192 defaultValue: 'Wait',
193 },
194 {
195 action: 'reload',
196 labelKey: 'common.retry',
197 defaultValue: 'Retry',
198 },
199 ],
200 defaultAction: 'reload',
201 cancelAction: 'wait',
202 });
203};
204
205export const promptMainWindowRenderProcessGone = (
206 window: BrowserWindow,

Callers 2

createWindowFunction · 0.90

Calls 3

showRecoveryDialogFunction · 0.85
formatRecoveryDetailFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected