aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/forgejo.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-03 21:05:15 +0900
committernsfisis <nsfisis@gmail.com>2026-06-03 21:05:15 +0900
commit27764ef4447a02e5c59bbcc7b4547838aae82d89 (patch)
treeade2b2c9ba2d4cc0a0b3ed66aa9b4e04754a9b7a /crates/shirabe/src/util/forgejo.rs
parenteacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6 (diff)
downloadphp-shirabe-27764ef4447a02e5c59bbcc7b4547838aae82d89.tar.gz
php-shirabe-27764ef4447a02e5c59bbcc7b4547838aae82d89.tar.zst
php-shirabe-27764ef4447a02e5c59bbcc7b4547838aae82d89.zip
refactor(downloader,repository,json): drop stale try/catch TODOs; fix svn getFileContent catch type
Remove 17 TODO(phase-b) markers across exception-modeling sites where the existing single-Result closure+match already faithfully models the PHP try/catch (catch paths only rethrow, retry, log, or silently ignore and never yield a recoverable value, so a double Result is unnecessary). Fix SvnDriver::get_file_content to catch only RuntimeException (matching PHP's catch RuntimeException) and extract its .message instead of calling e.to_string() on the anyhow::Error, which would panic while the shim exception Display is unimplemented; other errors now propagate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/forgejo.rs')
-rw-r--r--crates/shirabe/src/util/forgejo.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/forgejo.rs b/crates/shirabe/src/util/forgejo.rs
index 4db5815..232c8f3 100644
--- a/crates/shirabe/src/util/forgejo.rs
+++ b/crates/shirabe/src/util/forgejo.rs
@@ -122,8 +122,6 @@ impl Forgejo {
) {
Ok(_) => {}
Err(e) => {
- // TODO(phase-b): anyhow::Error has no get_code(); HTTP status codes come from
- // TransportException::get_status_code().
let code = e
.downcast_ref::<crate::downloader::TransportException>()
.and_then(|te| te.get_status_code())
@@ -140,7 +138,6 @@ impl Forgejo {
return Ok(Ok(false));
}
- // TODO(phase-b): downcast anyhow::Error to TransportException for the inner Err
return Err(e);
}
}