nanocoder
nanocoder copied to clipboard
Bug: 23+ silent catch {} blocks in git utilities swallow errors silently
Description
source/tools/git/utils.ts contains over 23 empty catch {} blocks that silently swallow errors. When git operations fail — branch listing, status checks, stash operations, commit queries — the failure is completely invisible, making debugging very difficult.
Affected Functions
The following functions return a safe fallback value with no logging when they fail:
| Function | Returns on failure |
|---|---|
hasUncommittedChanges() |
false |
hasStagedChanges() |
false |
getCurrentBranch() |
'HEAD' |
getDefaultBranch() (outer) |
falls through to branch name guessing |
getUpstreamBranch() |
null |
getAheadBehind() |
{ahead: 0, behind: 0} |
getLocalBranches() |
[] |
getRemoteBranches() |
[] |
getUnpushedCommits() |
[] |
isLastCommitPushed() |
false |
getCommits() |
[] |
getDiffStats() |
empty Map (has `// Ign |
b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b-b- ltBranch()— checking main/master branch names
Expected Behavior
Operational functions should log at debug level Operational functions should the exOperational functions should log at debug level Operational functionsror) {
logger.debug('git status check failed', {error});
return false;
}
This preserves the graceful fallbackThis preserves the graceful fals This preserves the graceful fall EThis preserves the graceful fale/toolThis preserves the grace0, 92, 104, 190, 202, 220, 232, 247, 263, 268, 272, 286, 297, 321, 359, 373, 391, 406, 449, 567, 596, 609, 625)