Skip to content

Commit 54a8bbd

Browse files
committed
fix: narrow NotFound handling to exclude missing cwd in AzureDevOpsCli
VcsProcessSpawnError with a NotFound platform cause can be triggered by either a missing executable or a non-existent working directory. The previous check only tested reason._tag === 'NotFound', which incorrectly diagnosed bad cwd paths as 'az CLI not available'. Add two additional guards mirroring the pattern in GitVcsDriverCore: - pathOrDescriptor !== context.cwd excludes fs.access cwd validation - syscall !== 'chdir' excludes the rare spawn-level cwd failure
1 parent 67eff03 commit 54a8bbd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/server/src/sourceControl/AzureDevOpsCli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export class AzureDevOpsCommandFailedError extends Schema.TaggedErrorClass<Azure
9494
if (
9595
cause._tag === "VcsProcessSpawnError" &&
9696
cause.cause instanceof PlatformError.PlatformError &&
97-
cause.cause.reason._tag === "NotFound"
97+
cause.cause.reason._tag === "NotFound" &&
98+
cause.cause.reason.pathOrDescriptor !== context.cwd &&
99+
cause.cause.reason.syscall !== "chdir"
98100
) {
99101
return new AzureDevOpsCliUnavailableError(fields);
100102
}

0 commit comments

Comments
 (0)