aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/repository_set.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/repository/repository_set.rs')
-rw-r--r--crates/shirabe/src/repository/repository_set.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/shirabe/src/repository/repository_set.rs b/crates/shirabe/src/repository/repository_set.rs
index ac904fc..1323fbd 100644
--- a/crates/shirabe/src/repository/repository_set.rs
+++ b/crates/shirabe/src/repository/repository_set.rs
@@ -395,12 +395,20 @@ impl RepositorySet {
match attempt {
Ok(_) => {}
Err(e) => {
- // TODO(phase-b): downcast e to \Composer\Downloader\TransportException
- let _te: &TransportException = todo!("downcast e to TransportException");
+ // PHP catches only \Composer\Downloader\TransportException; other
+ // exceptions propagate uncaught.
+ if e.downcast_ref::<TransportException>().is_none() {
+ return Err(e);
+ }
if !ignore_unreachable {
return Err(e);
}
- unreachable_repos.push(e.to_string());
+ let message = e
+ .downcast_ref::<TransportException>()
+ .unwrap()
+ .message
+ .clone();
+ unreachable_repos.push(message);
}
}
}