Skip to content

fix(branchlist): propagate error instead of panicking in switch_to_selected_branch#2976

Open
Noethix55555 wants to merge 1 commit into
gitui-org:masterfrom
Noethix55555:fix/branchlist-expect-panic
Open

fix(branchlist): propagate error instead of panicking in switch_to_selected_branch#2976
Noethix55555 wants to merge 1 commit into
gitui-org:masterfrom
Noethix55555:fix/branchlist-expect-panic

Conversation

@Noethix55555

Copy link
Copy Markdown

switch_to_selected_branch calls get_status(...).expect(...), which panics the whole app on any error (e.g. transient IO or permission failure). The function already returns Result<()> and is invoked via try_or_popup!, so propagating with ? instead lets the error surface as a popup rather than a crash.

Change

Replace .expect("Could not get status") with ? in src/popups/branchlist.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant