fix: distinguish evidence tree lookup failures

This commit is contained in:
2026-08-09 18:40:37 +02:00
parent 521288eb04
commit 266a604892
2 changed files with 16 additions and 2 deletions
+4 -2
View File
@@ -278,8 +278,10 @@ export class GitWorkspaceRepository {
);
return stdout;
} catch (error) {
if (invalidObjectMessage && typeof error === "object" && error !== null
&& "code" in error && typeof error.code === "number") {
const stderr = typeof error === "object" && error !== null && "stderr" in error
&& typeof error.stderr === "string" ? error.stderr : "";
if (invalidObjectMessage
&& /^fatal: path '[^']+' does not exist in '[0-9a-f]{40}'\s*$/u.test(stderr)) {
throw new WorkspaceRegistryError("workspace_invalid", invalidObjectMessage);
}
throw this.sanitizeGitError(error);