chore: generate

This commit is contained in:
opencode-agent[bot]
2026-05-21 04:56:41 +00:00
parent bea3ca5b05
commit 7566cfe602
+31 -16
View File
@@ -204,12 +204,17 @@ export function registerRendererProtocol() {
try { try {
const response = await net.fetch(pathToFileURL(file).toString()) const response = await net.fetch(pathToFileURL(file).toString())
if (response.status >= 400) { if (response.status >= 400) {
writeLog("protocol", "fetch failed", { writeLog(
url: request.url, "protocol",
file, "fetch failed",
status: response.status, {
statusText: response.statusText, url: request.url,
}, "error") file,
status: response.status,
statusText: response.statusText,
},
"error",
)
} }
return addDocumentPolicy(response, file) return addDocumentPolicy(response, file)
} catch (error) { } catch (error) {
@@ -282,15 +287,20 @@ function wireWindowRecovery(win: BrowserWindow, name: string) {
validatedURL: string, validatedURL: string,
isMainFrame: boolean, isMainFrame: boolean,
) => { ) => {
writeLog("window", "renderer load failed", { writeLog(
window: name, "window",
event, "renderer load failed",
errorCode, {
errorDescription, window: name,
validatedURL, event,
currentURL: win.webContents.getURL(), errorCode,
isMainFrame, errorDescription,
}, "error") validatedURL,
currentURL: win.webContents.getURL(),
isMainFrame,
},
"error",
)
if (!isMainFrame || errorCode === -3) return if (!isMainFrame || errorCode === -3) return
void show( void show(
@@ -308,7 +318,12 @@ function wireWindowRecovery(win: BrowserWindow, name: string) {
}) })
win.webContents.on("render-process-gone", (_event, details) => { win.webContents.on("render-process-gone", (_event, details) => {
sampler.stopAndFlush() sampler.stopAndFlush()
writeLog("window", "renderer process gone", { window: name, currentURL: win.webContents.getURL(), details }, "error") writeLog(
"window",
"renderer process gone",
{ window: name, currentURL: win.webContents.getURL(), details },
"error",
)
void show( void show(
"OpenCode window terminated unexpectedly", "OpenCode window terminated unexpectedly",
[`Window: ${name}`, `Reason: ${details.reason}`, `Code: ${details.exitCode ?? "<unknown>"}`].join("\n"), [`Window: ${name}`, `Reason: ${details.reason}`, `Code: ${details.exitCode ?? "<unknown>"}`].join("\n"),