( session: ExecutionSession, workspacePath: string, gitAuthor: GitAuthorConfig )
| 847 | logger.error('Git clone failed', { |
| 848 | error: sanitizeGitOutput(errorMessage), |
| 849 | gitUrl: sanitizedGitUrl, |
| 850 | }); |
| 851 | |
| 852 | if (isSandboxInternalServerError(err)) { |
| 853 | throw err; |
| 854 | } |
| 855 | |
| 856 | // Detect "repository not found" — a user-caused error (bad repo or |
| 857 | // missing access). The sandbox SDK surfaces git stderr in the error |
| 858 | // message, including patterns like: |
| 859 | // "remote: Repository not found." |
| 860 | // "fatal: repository '...' not found" |
| 861 | const stderr = extractStderr(err); |
| 862 | const haystack = `${errorMessage}\n${stderr}`; |
| 863 | if (REPO_NOT_FOUND_PATTERN.test(haystack)) { |
| 864 | throw new GitRepositoryNotFoundError(sanitizedGitUrl); |
| 865 | } |
| 866 | |
| 867 | throw new GitCloneFailedError(sanitizedGitUrl, sanitizeGitOutput(errorMessage)); |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | export type RestoreWorkspaceOptions = { |
| 872 | githubRepo?: string; |
no test coverage detected