From 8888e4b8bfeb41e4edd45ab47db8a293e93ded3f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 3 Jun 2026 00:57:47 +0900 Subject: feat(downloader,repository): wire exception instanceof downcasts via anyhow Resolve the PHP try/catch instanceof checks that select on exception type: TransportException-only catches in RepositorySet, SvnDriver and JsonFile; the RuntimeException/IrrecoverableDownloadException handleError closure and the RuntimeException update-retry catch in DownloadManager. Each uses anyhow::Error::downcast_ref and reads the exception's message field directly (Display is todo\!() on the shim exceptions). PHPUnit\Framework\Exception checks in VcsDownloader are documented as intentionally always-false since the test framework is out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/installer/installation_manager.rs | 3 --- 1 file changed, 3 deletions(-) (limited to 'crates/shirabe/src/installer/installation_manager.rs') diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs index b95ad26..073625b 100644 --- a/crates/shirabe/src/installer/installation_manager.rs +++ b/crates/shirabe/src/installer/installation_manager.rs @@ -208,7 +208,6 @@ impl InstallationManager { let mut batch: IndexMap> = IndexMap::new(); for (index, operation) in operations.into_iter().enumerate() { let index = index as i64; - // PHP: $operation instanceof UpdateOperation || $operation instanceof InstallOperation let package: Option = if let Some(update) = operation.as_update_operation() { Some(update.get_target_package()) @@ -367,7 +366,6 @@ impl InstallationManager { let mut batches: Vec>> = vec![]; let mut batch: IndexMap> = IndexMap::new(); for (index, operation) in operations { - // PHP: $operation instanceof InstallOperation || $operation instanceof UpdateOperation let package: Option = if let Some(update) = operation.as_update_operation() { Some(update.get_target_package()) @@ -444,7 +442,6 @@ impl InstallationManager { io_interface::NORMAL, ); } - // PHP: $this->{$opType}($repo, $operation); match op_type.as_str() { "markAliasInstalled" => { let op = operation -- cgit v1.3.1