mirror of
https://github.com/siteboon/claudecodeui.git
synced 2025-12-13 13:49:43 +00:00
Apply suggestion from @coderabbitai[bot]
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -101,7 +101,12 @@ router.post('/create-workspace', async (req, res) => {
|
|||||||
await cloneGitHubRepository(githubUrl, absolutePath, githubToken);
|
await cloneGitHubRepository(githubUrl, absolutePath, githubToken);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Clean up created directory on failure
|
// Clean up created directory on failure
|
||||||
|
try {
|
||||||
await fs.rm(absolutePath, { recursive: true, force: true });
|
await fs.rm(absolutePath, { recursive: true, force: true });
|
||||||
|
} catch (cleanupError) {
|
||||||
|
console.error('Failed to clean up directory after clone failure:', cleanupError);
|
||||||
|
// Continue to throw original error
|
||||||
|
}
|
||||||
throw new Error(`Failed to clone repository: ${error.message}`);
|
throw new Error(`Failed to clone repository: ${error.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user