mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-06-08 17:10:20 +08:00
log out the reason PUPPETEER_DOWNLOAD_ENCOUNTER_ERROR
This commit is contained in:
@@ -14,7 +14,7 @@ export default defineConfig({
|
||||
},
|
||||
plugins: [
|
||||
externalizeDepsPlugin({
|
||||
exclude: ['@geekgeekrun/geek-auto-start-chat-with-boss', '@geekgeekrun/dingtalk-plugin', 'find-chrome-bin']
|
||||
exclude: ['@geekgeekrun/geek-auto-start-chat-with-boss', '@geekgeekrun/dingtalk-plugin', '@geekgeekrun/utils', 'find-chrome-bin']
|
||||
})
|
||||
]
|
||||
},
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"@geekgeekrun/dingtalk-plugin": "workspace:*",
|
||||
"@geekgeekrun/geek-auto-start-chat-with-boss": "workspace:*",
|
||||
"@geekgeekrun/utils": "workspace:*",
|
||||
"@puppeteer/browsers": "^2.0.0",
|
||||
"JSONStream": "^1.3.5",
|
||||
"electron-updater": "^6.1.7",
|
||||
|
||||
@@ -11,6 +11,9 @@ import {
|
||||
saveLastUsedAndAvailableBrowserPath
|
||||
} from './history-utils'
|
||||
import findAndLocateExistedChromiumExecutable from './check-and-locate-existed-chromium-executable'
|
||||
import {
|
||||
sleep
|
||||
} from '@geekgeekrun/utils/sleep.mjs'
|
||||
|
||||
export enum DOWNLOAD_ERROR_EXIT_CODE {
|
||||
NO_ERROR = 0,
|
||||
@@ -118,6 +121,18 @@ export const checkAndDownloadDependenciesForInit = async () => {
|
||||
app.exit(DOWNLOAD_ERROR_EXIT_CODE.NO_ERROR)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
pipeWriteRegardlessError(
|
||||
pipe,
|
||||
JSON.stringify({
|
||||
type: 'PUPPETEER_DOWNLOAD_ENCOUNTER_ERROR',
|
||||
...err instanceof Error ? {
|
||||
name: err.name,
|
||||
message: err.message,
|
||||
stack: err.stack
|
||||
} : null
|
||||
}) + '\r\n'
|
||||
)
|
||||
await sleep(1000)
|
||||
app.exit(DOWNLOAD_ERROR_EXIT_CODE.DOWNLOAD_ERROR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,10 @@ export function createMainWindow(): void {
|
||||
mainWindow?.webContents.send(data.type, data)
|
||||
break
|
||||
}
|
||||
case 'PUPPETEER_DOWNLOAD_ENCOUNTER_ERROR': {
|
||||
console.error(data)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user