mirror of
https://github.com/stablyai/orca.git
synced 2026-10-29 16:17:51 +00:00
fix: address pr-bug-scan validated finding from #6527
Wrapped pairing-runtime startup in main() in a local try/catch so its failure logs a warning and continues the launch instead of hitting main()'s catch+exit(1).
This commit is contained in:
@@ -545,19 +545,28 @@ async function main() {
|
||||
logInfo(`Using worktree: ${worktree}`)
|
||||
await ensureMobileDependencies(worktree)
|
||||
|
||||
pairingRuntime = await startHeadlessPairingRuntime({
|
||||
enabled: options.pair,
|
||||
orcaCli: ORCA_CLI,
|
||||
cwd: process.cwd(),
|
||||
lanIpCandidates,
|
||||
logStep,
|
||||
logSuccess
|
||||
})
|
||||
await registerWorktreeForPairingRuntime(pairingRuntime, worktree, {
|
||||
orca,
|
||||
logStep,
|
||||
logSuccess
|
||||
})
|
||||
// Why: the temporary pairing runtime is auxiliary to launching the app. If it
|
||||
// fails to start, never emits a pairing URL, or its worktree registration
|
||||
// fails, keep going with the app launch instead of aborting the whole flow.
|
||||
try {
|
||||
pairingRuntime = await startHeadlessPairingRuntime({
|
||||
enabled: options.pair,
|
||||
orcaCli: ORCA_CLI,
|
||||
cwd: process.cwd(),
|
||||
lanIpCandidates,
|
||||
logStep,
|
||||
logSuccess
|
||||
})
|
||||
await registerWorktreeForPairingRuntime(pairingRuntime, worktree, {
|
||||
orca,
|
||||
logStep,
|
||||
logSuccess
|
||||
})
|
||||
} catch (error) {
|
||||
pairingRuntime?.stop()
|
||||
pairingRuntime = null
|
||||
logError(`Skipping mobile pairing: ${error.message}`)
|
||||
}
|
||||
|
||||
// Find best device
|
||||
const device = await findBestDevice(options.device)
|
||||
|
||||
Reference in New Issue
Block a user