mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
fix(commit_files): avoid panic when async fetch fails
Log fetch and notification errors instead of unwrapping in the background worker, consistent with revlog and status. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8619c07f3f
commit
2c8b3744ba
1 changed files with 10 additions and 5 deletions
|
|
@ -108,14 +108,19 @@ impl AsyncCommitFiles {
|
|||
self.pending.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
rayon_core::spawn(move || {
|
||||
Self::fetch_helper(&repo, params, &arc_current)
|
||||
.expect("failed to fetch");
|
||||
if let Err(e) =
|
||||
Self::fetch_helper(&repo, params, &arc_current)
|
||||
{
|
||||
log::error!("commit_files fetch_helper: {e}");
|
||||
}
|
||||
|
||||
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
||||
|
||||
sender
|
||||
.send(AsyncGitNotification::CommitFiles)
|
||||
.expect("error sending");
|
||||
if let Err(e) =
|
||||
sender.send(AsyncGitNotification::CommitFiles)
|
||||
{
|
||||
log::error!("commit_files notify error: {e}");
|
||||
}
|
||||
});
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Reference in a new issue