fix: replace silent error swallowing with proper error propagation
Replace .filter_map(Result::ok).collect() with .collect::<Result<Vec<_>,_>>()? in rename chain resolution and suffix probe queries. The old pattern silently discarded database errors, making failures invisible. Now any rusqlite error propagates to the caller immediately. Affected: resolve_rename_chain (2 queries) and resolve_ambiguity (1 query). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -294,8 +294,7 @@ fn try_resolve_rename_ambiguity(
|
||||
|
||||
let old_paths: Vec<String> = stmt
|
||||
.query_map(param_refs.as_slice(), |row| row.get(0))?
|
||||
.filter_map(std::result::Result::ok)
|
||||
.collect();
|
||||
.collect::<std::result::Result<Vec<_>, _>>()?;
|
||||
|
||||
// The newest path is a candidate that is NOT an old_path in any intra-chain rename.
|
||||
let newest = candidates.iter().find(|c| !old_paths.contains(c));
|
||||
|
||||
Reference in New Issue
Block a user