diff --git a/src/extensions/default/Git/src/Panel.js b/src/extensions/default/Git/src/Panel.js
index b183ceacf..d3a2c4fbe 100644
--- a/src/extensions/default/Git/src/Panel.js
+++ b/src/extensions/default/Git/src/Panel.js
@@ -742,7 +742,7 @@ define(function (require, exports) {
}
p.catch(function (err) {
- ErrorHandler.showError(err, "Preparing commit dialog failed");
+ ErrorHandler.showError(err, Strings.ERROR_PREPARING_COMMIT_DIALOG);
}).finally(function () {
Utils.unsetLoading($gitPanel.find(".git-commit"));
});
@@ -956,7 +956,12 @@ define(function (require, exports) {
return Git.resetIndex();
})
.then(function () {
- return handleGitCommit(lastCommitMessage[ProjectManager.getProjectRoot().fullPath], false, COMMIT_MODE.CURRENT);
+ return handleGitCommit(lastCommitMessage[ProjectManager.getProjectRoot().fullPath],
+ false, COMMIT_MODE.CURRENT);
+ }).catch((err)=>{
+ console.error(err);
+ // rethrowing with stripped git error details as it may have sensitive info
+ throw new Error("Error commitCurrentFile in git panel.js. this should not have happened here.");
});
}
@@ -967,7 +972,12 @@ define(function (require, exports) {
return Git.resetIndex();
})
.then(function () {
- return handleGitCommit(lastCommitMessage[ProjectManager.getProjectRoot().fullPath], false, COMMIT_MODE.ALL);
+ return handleGitCommit(lastCommitMessage[ProjectManager.getProjectRoot().fullPath],
+ false, COMMIT_MODE.ALL);
+ }).catch((err)=>{
+ console.error(err);
+ // rethrowing with stripped git error details as it may have sensitive info
+ throw new Error("Error commitAllFiles in git panel.js. this should not have happened here.");
});
}
@@ -1232,13 +1242,20 @@ define(function (require, exports) {
.on("click", ".check-all", function () {
if ($(this).is(":checked")) {
return Git.stageAll().then(function () {
- Git.status();
- });
- } else {
- return Git.resetIndex().then(function () {
- Git.status();
+ return Git.status();
+ }).catch((err)=>{
+ console.error(err);
+ // rethrowing with stripped git error details as it may have sensitive info
+ throw new Error("Error stage all by checkbox in git panel.js. this should not have happened");
});
}
+ return Git.resetIndex().then(function () {
+ return Git.status();
+ }).catch((err)=>{
+ console.error(err);
+ // rethrowing with stripped git error details as it may have sensitive info
+ throw new Error("Error unstage all by checkbox in git panel.js. this should not have happened");
+ });
})
.on("click", ".git-refresh", EventEmitter.getEmitter(Events.REFRESH_ALL, ["panel", "refreshBtn"]))
.on("click", ".git-commit", EventEmitter.getEmitter(Events.HANDLE_GIT_COMMIT))
diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js
index 4f508f28c..d37504a04 100644
--- a/src/nls/root/strings.js
+++ b/src/nls/root/strings.js
@@ -1529,6 +1529,7 @@ define({
"ERROR_NO_REMOTE_SELECTED": "No remote has been selected for {0}!",
"ERROR_BRANCH_LIST": "Getting branch list failed",
"ERROR_FETCH_REMOTE": "Fetching remote information failed",
+ "ERROR_PREPARING_COMMIT_DIALOG": "Preparing commit dialog failed",
"GIT_TOAST_TITLE": "Explore Git Features in Phoenix Code",
"GIT_TOAST_MESSAGE": "Click the Git panel icon to manage your repository. Easily commit, push, pull, and view your project history—all in one place.
Learn more about the Git panel →",