Skip to content

Commit ca0834c

Browse files
committed
chore: reveiwed uncaught exception handlers in git
1 parent e25cf52 commit ca0834c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/extensions/default/Git/src/Branch.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ define(function (require, exports) {
128128
}
129129
}
130130
});
131+
}).catch(err => {
132+
console.error("Error Getting branches", err);
133+
// we need to strip all user entered info from git thrown exception for get branches which shouldn't fail,
134+
// so we throw a blank error for bugsnag
135+
throw new Error("Failed to get getBranches while doMerge");
131136
});
132137
}
133138

@@ -168,7 +173,7 @@ define(function (require, exports) {
168173

169174
Git.getAllBranches().catch(function (err) {
170175
ErrorHandler.showError(err);
171-
}).then(function (branches) {
176+
}).then(function (branches = []) {
172177

173178
var compiledTemplate = Mustache.render(newBranchTemplate, {
174179
branches: branches,
@@ -335,7 +340,7 @@ define(function (require, exports) {
335340

336341
Git.getBranches().catch(function (err) {
337342
ErrorHandler.showError(err, Strings.ERROR_GETTING_BRANCH_LIST);
338-
}).then(function (branches) {
343+
}).then(function (branches = []) {
339344
branches = branches.reduce(function (arr, branch) {
340345
if (!branch.currentBranch && !branch.remote) {
341346
arr.push(branch.name);

0 commit comments

Comments
 (0)