Skip to content

Commit

Permalink
chore: reveiwed uncaught exception handlers in git
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Jan 25, 2025
1 parent 8260675 commit 6e895b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/extensions/default/Git/src/Branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ define(function (require, exports) {
}
}
});
}).catch(err => {
console.error("Error Getting branches", err);
// we need to strip all user entered info from git thrown exception for get branches which shouldn't fail,
// so we throw a blank error for bugsnag
throw new Error("Failed to get getBranches while doMerge");
});
}

Expand Down Expand Up @@ -168,7 +173,7 @@ define(function (require, exports) {

Git.getAllBranches().catch(function (err) {
ErrorHandler.showError(err);
}).then(function (branches) {
}).then(function (branches = []) {

var compiledTemplate = Mustache.render(newBranchTemplate, {
branches: branches,
Expand Down Expand Up @@ -335,7 +340,7 @@ define(function (require, exports) {

Git.getBranches().catch(function (err) {
ErrorHandler.showError(err, Strings.ERROR_GETTING_BRANCH_LIST);
}).then(function (branches) {
}).then(function (branches = []) {
branches = branches.reduce(function (arr, branch) {
if (!branch.currentBranch && !branch.remote) {
arr.push(branch.name);
Expand Down

0 comments on commit 6e895b4

Please sign in to comment.