chore: generate

This commit is contained in:
opencode-agent[bot]
2026-05-21 04:56:41 +00:00
parent bea3ca5b05
commit 7566cfe602
+20 -5
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(
"protocol",
"fetch failed",
{
url: request.url, url: request.url,
file, file,
status: response.status, status: response.status,
statusText: response.statusText, statusText: response.statusText,
}, "error") },
"error",
)
} }
return addDocumentPolicy(response, file) return addDocumentPolicy(response, file)
} catch (error) { } catch (error) {
@@ -282,7 +287,10 @@ function wireWindowRecovery(win: BrowserWindow, name: string) {
validatedURL: string, validatedURL: string,
isMainFrame: boolean, isMainFrame: boolean,
) => { ) => {
writeLog("window", "renderer load failed", { writeLog(
"window",
"renderer load failed",
{
window: name, window: name,
event, event,
errorCode, errorCode,
@@ -290,7 +298,9 @@ function wireWindowRecovery(win: BrowserWindow, name: string) {
validatedURL, validatedURL,
currentURL: win.webContents.getURL(), currentURL: win.webContents.getURL(),
isMainFrame, isMainFrame,
}, "error") },
"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"),