mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-05 15:30:48 +00:00
update error popup
This commit is contained in:
parent
5f5387c6b7
commit
f05c0537d5
11 changed files with 142 additions and 40 deletions
|
|
@ -29,12 +29,16 @@ export function runInstallScript(scriptPath: string): Promise<boolean> {
|
|||
env: { ...process.env, ELECTRON_RUN_AS_NODE: '1' }
|
||||
})
|
||||
|
||||
let stderrOutput = '';
|
||||
|
||||
nodeProcess.stdout.on('data', (data) => {
|
||||
log.info(`Script output: ${data}`)
|
||||
})
|
||||
|
||||
nodeProcess.stderr.on('data', (data) => {
|
||||
log.error(`Script error: ${data}`)
|
||||
const errorMsg = data.toString();
|
||||
stderrOutput += errorMsg;
|
||||
log.error(`Script error: ${errorMsg}`)
|
||||
})
|
||||
|
||||
nodeProcess.on('close', (code) => {
|
||||
|
|
@ -43,7 +47,9 @@ export function runInstallScript(scriptPath: string): Promise<boolean> {
|
|||
resolve(true)
|
||||
} else {
|
||||
log.error(`Script exited with code ${code}`)
|
||||
reject(false)
|
||||
// Reject with detailed error message instead of just false
|
||||
const errorMessage = stderrOutput.trim() || `Script exited with code ${code}`;
|
||||
reject(new Error(errorMessage))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue