Files
orca/src/main/cli/cli-install-errors.ts
T
OrcaWinandm4air 6dab0cb7fe refactor(ipc-persistence-shared): clean up Phase 3-3.8 code (#26902)
- Install store domain contexts with one generic symbol copy
- Share one import-source classifier and one copy-name deconflicter across local, SSH and runtime-upload imports
- Collapse kill.ts synthetic-exit and stop-failure repetition into helpers
- Use Promise.allSettled in SSH transport teardown
- Use the shared errorMessage() instead of inline copies
- Fold isLiveSshPtyLease into ssh-types and drop the duplicate predicate

Co-authored-by: m4air <m4air@Mac.localdomain>
2026-10-09 12:33:19 -07:00

25 lines
906 B
TypeScript

export function isMissingError(error: unknown): boolean {
return (
error instanceof Error && 'code' in error && (error as NodeJS.ErrnoException).code === 'ENOENT'
)
}
// Why: localized permission errors keep these .NET/ACL markers even when the PowerShell text is mojibake.
export function isWindowsUserPathPermissionError(error: unknown): boolean {
if (!(error instanceof Error)) {
return false
}
const stderr =
'stderr' in error && typeof (error as { stderr?: unknown }).stderr === 'string'
? (error as { stderr: string }).stderr
: ''
const haystack = `${error.message}\n${stderr}`
return (
haystack.includes('UnauthorizedAccessException') ||
haystack.includes('SecurityException') ||
haystack.includes('Requested registry access is not allowed') ||
haystack.includes('Access is denied') ||
haystack.includes('Access to the registry key')
)
}