Unverified Commit 2632a459 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: fix unhelpful error message when deleting folder fails (#81718)

### What?

Fixes the unhelpful error message:

```
[Error: No such file or directory (os error 2)] {
  code: 'GenericFailure'
}
```
parent d5685504
...@@ -143,8 +143,11 @@ pub fn handle_db_versioning( ...@@ -143,8 +143,11 @@ pub fn handle_db_versioning(
} }
} else { } else {
path = base_path.join("temp"); path = base_path.join("temp");
// propagate errors: if this fails we may have stale files left over in the temp directory if path.exists() {
remove_dir_all(&path)?; // propagate errors: if this fails we may have stale files left over in the temp
// directory
remove_dir_all(&path)?;
}
} }
Ok(path) Ok(path)
......
...@@ -166,9 +166,11 @@ impl<T: KeyValueDatabase> KeyValueDatabaseBackingStorage<T> { ...@@ -166,9 +166,11 @@ impl<T: KeyValueDatabase> KeyValueDatabaseBackingStorage<T> {
where where
T: Send + Sync + 'static, T: Send + Sync + 'static,
{ {
let startup_cache_state = check_db_invalidation_and_cleanup(&base_path)?; let startup_cache_state = check_db_invalidation_and_cleanup(&base_path)
let versioned_path = handle_db_versioning(&base_path, version_info, is_ci)?; .context("Failed to check database invalidation and cleanup")?;
let database = (database)(versioned_path)?; let versioned_path = handle_db_versioning(&base_path, version_info, is_ci)
.context("Failed to handle database versioning")?;
let database = (database)(versioned_path).context("Failed to open database")?;
let backing_storage = Self { let backing_storage = Self {
inner: Arc::new_cyclic( inner: Arc::new_cyclic(
move |weak_inner: &Weak<KeyValueDatabaseBackingStorageInner<T>>| { move |weak_inner: &Weak<KeyValueDatabaseBackingStorageInner<T>>| {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment