(
window: BrowserWindow,
details: {
errorCode: number;
errorDescription: string;
validatedURL: string;
isMainFrame: boolean;
}
)
| 166 | }; |
| 167 | |
| 168 | export 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 | |
| 205 | export const promptMainWindowRenderProcessGone = ( |
| 206 | window: BrowserWindow, |
no test coverage detected