diff --git a/src/agent/onefuzz/src/blob/url.rs b/src/agent/onefuzz/src/blob/url.rs index 38663c1ff3..0e62772ed0 100644 --- a/src/agent/onefuzz/src/blob/url.rs +++ b/src/agent/onefuzz/src/blob/url.rs @@ -151,7 +151,8 @@ impl BlobContainerUrl { pub fn url(&self) -> Result { match self { Self::BlobContainer(url) => Ok(url.clone()), - Self::Path(p) => Ok(Url::from_file_path(p).map_err(|_| anyhow!("invalid path"))?), + Self::Path(p) => Ok(Url::from_file_path(p) + .map_err(|err| anyhow!("invalid path. path:{} error:{:?}", p.display(), err))?), } } diff --git a/src/agent/onefuzz/src/syncdir.rs b/src/agent/onefuzz/src/syncdir.rs index 5025c00c52..c73ac8e4c8 100644 --- a/src/agent/onefuzz/src/syncdir.rs +++ b/src/agent/onefuzz/src/syncdir.rs @@ -38,7 +38,13 @@ pub struct SyncedDir { impl SyncedDir { pub fn remote_url(&self) -> Result { let url = self.remote_path.clone().unwrap_or(BlobContainerUrl::new( - Url::from_file_path(self.local_path.clone()).map_err(|_| anyhow!("invalid path"))?, + Url::from_file_path(self.local_path.clone()).map_err(|err| { + anyhow!( + "invalid path: {} error:{:?}", + self.local_path.display(), + err + ) + })?, )?); Ok(url) } @@ -89,7 +95,9 @@ impl SyncedDir { pub async fn init(&self) -> Result<()> { if let Some(remote_path) = self.remote_path.clone().and_then(|u| u.as_file_path()) { - fs::create_dir_all(remote_path).await?; + fs::create_dir_all(&remote_path).await.with_context(|| { + format!("unable to create directory: {}", remote_path.display()) + })?; } match fs::metadata(&self.local_path).await {