aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/repository')
-rw-r--r--crates/shirabe/src/repository/filesystem_repository.rs1
-rw-r--r--crates/shirabe/src/repository/repository_set.rs1
-rw-r--r--crates/shirabe/src/repository/vcs/svn_driver.rs8
3 files changed, 4 insertions, 6 deletions
diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs
index a721b4f..db9a8c6 100644
--- a/crates/shirabe/src/repository/filesystem_repository.rs
+++ b/crates/shirabe/src/repository/filesystem_repository.rs
@@ -94,7 +94,6 @@ impl FilesystemRepository {
return Ok(());
}
- // TODO(phase-b): use anyhow::Result<Result<T, E>> to model PHP try/catch
let packages: PhpMixed = match (|| -> Result<PhpMixed> {
let data = self.file.read()?;
let packages_value = if let PhpMixed::Array(ref m) = data {
diff --git a/crates/shirabe/src/repository/repository_set.rs b/crates/shirabe/src/repository/repository_set.rs
index 1323fbd..077c3f6 100644
--- a/crates/shirabe/src/repository/repository_set.rs
+++ b/crates/shirabe/src/repository/repository_set.rs
@@ -374,7 +374,6 @@ impl RepositorySet {
) -> Result<IndexMap<String, Vec<PartialOrFullSecurityAdvisory>>> {
let mut repo_advisories: Vec<IndexMap<String, Vec<PartialOrFullSecurityAdvisory>>> = vec![];
for repository in &self.repositories {
- // TODO(phase-b): use anyhow::Result<Result<T, E>> to model PHP try/catch
let attempt: Result<()> = (|| -> Result<()> {
let repo_ref = repository.borrow();
let Some(advisory_repo) = repo_ref.as_advisory_provider() else {
diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs
index 2812c8d..23ea703 100644
--- a/crates/shirabe/src/repository/vcs/svn_driver.rs
+++ b/crates/shirabe/src/repository/vcs/svn_driver.rs
@@ -171,7 +171,6 @@ impl SvnDriver {
}
}
- // TODO(phase-b): use anyhow::Result<Result<T, E>> to model PHP try/catch
let base_result =
self.get_file_content("composer.json", identifier)
.and_then(|file_content| {
@@ -259,14 +258,16 @@ impl SvnDriver {
(identifier.clone(), String::new())
};
- // TODO(phase-b): use anyhow::Result<Result<T, E>> to model PHP try/catch
let output: String = match self.execute(
vec!["svn".to_string(), "cat".to_string()],
&format!("{}{}{}", self.base_url, path, rev),
) {
Ok(o) => o,
Err(e) => {
- return Err(TransportException::new(e.to_string(), 0).into());
+ if let Some(e) = e.downcast_ref::<RuntimeException>() {
+ return Err(TransportException::new(e.message.clone(), 0).into());
+ }
+ return Err(e);
}
};
if trim(&output, None) == "" {
@@ -557,7 +558,6 @@ impl SvnDriver {
.set_cache_credentials(self.cache_credentials);
}
- // TODO(phase-b): use anyhow::Result<Result<T, E>> to model PHP try/catch
match self
.util
.as_mut()