diff --git a/Frontend/src/scripts/features/branches.ts b/Frontend/src/scripts/features/branches.ts index 63c4a2e..5b0bea3 100644 --- a/Frontend/src/scripts/features/branches.ts +++ b/Frontend/src/scripts/features/branches.ts @@ -181,8 +181,9 @@ export function bindBranchUI() { notify(`Switched to ${name}`); await renderList(); // higher-level refresh await runHook('postSwitchBranch', hookData); - } catch { - notify('Checkout failed'); + } catch (err) { + const details = err instanceof Error ? err.message : String(err); + notify(`Checkout failed: ${details}`); } } @@ -218,7 +219,7 @@ export function bindBranchUI() { notify(`Merged branch '${name}' into '${cur}'`); await Promise.allSettled([renderList(), loadBranches()]); } catch (e) { - const msg = String(e || ''); + const msg = String(e); const looksLikeConflict = /CONFLICT/i.test(msg) || /Automatic merge failed/i.test(msg) || @@ -269,7 +270,7 @@ export function bindBranchUI() { await loadBranches(); await runHook('postBranchDelete', hookData); } catch (e) { - const msg = String(e || ''); + const msg = String(e); if (wantForce) { notify(`Force delete failed${msg ? `: ${msg}` : ''}`); return; } // If not fully merged, offer force delete as a fallback const ok2 = await confirmDeleteBranch({