mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
refactor: improve cleanup error handling and verbose logging
This commit is contained in:
parent
ac160cac12
commit
c5919f0c15
1 changed files with 15 additions and 10 deletions
|
@ -859,28 +859,33 @@ def run_test_real(
|
||||||
if target_dir.exists():
|
if target_dir.exists():
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(target_dir)
|
shutil.rmtree(target_dir)
|
||||||
print(f"Cleaned up Rust target/debug directory: {target_dir}")
|
if verbose:
|
||||||
except Exception as e:
|
print(f"Cleaned up Rust target/debug directory: {target_dir}")
|
||||||
# ignore all these exceptions on cleanup. ai!
|
except (OSError, shutil.Error, PermissionError) as e:
|
||||||
print(f"Failed to clean up Rust target/debug directory: {e}")
|
if verbose:
|
||||||
|
print(f"Failed to clean up Rust target/debug directory: {e}")
|
||||||
|
|
||||||
# Java build directories
|
# Java build directories
|
||||||
java_build_dir = testdir / "build"
|
java_build_dir = testdir / "build"
|
||||||
if java_build_dir.exists():
|
if java_build_dir.exists():
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(java_build_dir)
|
shutil.rmtree(java_build_dir)
|
||||||
print(f"Cleaned up Java build directory: {java_build_dir}")
|
if verbose:
|
||||||
except Exception as e:
|
print(f"Cleaned up Java build directory: {java_build_dir}")
|
||||||
print(f"Failed to clean up Java build directory: {e}")
|
except (OSError, shutil.Error, PermissionError) as e:
|
||||||
|
if verbose:
|
||||||
|
print(f"Failed to clean up Java build directory: {e}")
|
||||||
|
|
||||||
# Node.js node_modules directories
|
# Node.js node_modules directories
|
||||||
node_modules_dir = testdir / "node_modules"
|
node_modules_dir = testdir / "node_modules"
|
||||||
if node_modules_dir.exists():
|
if node_modules_dir.exists():
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(node_modules_dir)
|
shutil.rmtree(node_modules_dir)
|
||||||
print(f"Cleaned up Node.js node_modules directory: {node_modules_dir}")
|
if verbose:
|
||||||
except Exception as e:
|
print(f"Cleaned up Node.js node_modules directory: {node_modules_dir}")
|
||||||
print(f"Failed to clean up Node.js node_modules directory: {e}")
|
except (OSError, shutil.Error, PermissionError) as e:
|
||||||
|
if verbose:
|
||||||
|
print(f"Failed to clean up Node.js node_modules directory: {e}")
|
||||||
|
|
||||||
results = dict(
|
results = dict(
|
||||||
testdir=str(testdir),
|
testdir=str(testdir),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue