@@ -742,7 +742,7 @@ define(function (require, exports) {
742742 }
743743
744744 p . catch ( function ( err ) {
745- ErrorHandler . showError ( err , "Preparing commit dialog failed" ) ;
745+ ErrorHandler . showError ( err , Strings . ERROR_PREPARING_COMMIT_DIALOG ) ;
746746 } ) . finally ( function ( ) {
747747 Utils . unsetLoading ( $gitPanel . find ( ".git-commit" ) ) ;
748748 } ) ;
@@ -956,7 +956,12 @@ define(function (require, exports) {
956956 return Git . resetIndex ( ) ;
957957 } )
958958 . then ( function ( ) {
959- return handleGitCommit ( lastCommitMessage [ ProjectManager . getProjectRoot ( ) . fullPath ] , false , COMMIT_MODE . CURRENT ) ;
959+ return handleGitCommit ( lastCommitMessage [ ProjectManager . getProjectRoot ( ) . fullPath ] ,
960+ false , COMMIT_MODE . CURRENT ) ;
961+ } ) . catch ( ( err ) => {
962+ console . error ( err ) ;
963+ // rethrowing with stripped git error details as it may have sensitive info
964+ throw new Error ( "Error commitCurrentFile in git panel.js. this should not have happened here." ) ;
960965 } ) ;
961966 }
962967
@@ -967,7 +972,12 @@ define(function (require, exports) {
967972 return Git . resetIndex ( ) ;
968973 } )
969974 . then ( function ( ) {
970- return handleGitCommit ( lastCommitMessage [ ProjectManager . getProjectRoot ( ) . fullPath ] , false , COMMIT_MODE . ALL ) ;
975+ return handleGitCommit ( lastCommitMessage [ ProjectManager . getProjectRoot ( ) . fullPath ] ,
976+ false , COMMIT_MODE . ALL ) ;
977+ } ) . catch ( ( err ) => {
978+ console . error ( err ) ;
979+ // rethrowing with stripped git error details as it may have sensitive info
980+ throw new Error ( "Error commitAllFiles in git panel.js. this should not have happened here." ) ;
971981 } ) ;
972982 }
973983
@@ -1232,13 +1242,20 @@ define(function (require, exports) {
12321242 . on ( "click" , ".check-all" , function ( ) {
12331243 if ( $ ( this ) . is ( ":checked" ) ) {
12341244 return Git . stageAll ( ) . then ( function ( ) {
1235- Git . status ( ) ;
1236- } ) ;
1237- } else {
1238- return Git . resetIndex ( ) . then ( function ( ) {
1239- Git . status ( ) ;
1245+ return Git . status ( ) ;
1246+ } ) . catch ( ( err ) => {
1247+ console . error ( err ) ;
1248+ // rethrowing with stripped git error details as it may have sensitive info
1249+ throw new Error ( "Error stage all by checkbox in git panel.js. this should not have happened" ) ;
12401250 } ) ;
12411251 }
1252+ return Git . resetIndex ( ) . then ( function ( ) {
1253+ return Git . status ( ) ;
1254+ } ) . catch ( ( err ) => {
1255+ console . error ( err ) ;
1256+ // rethrowing with stripped git error details as it may have sensitive info
1257+ throw new Error ( "Error unstage all by checkbox in git panel.js. this should not have happened" ) ;
1258+ } ) ;
12421259 } )
12431260 . on ( "click" , ".git-refresh" , EventEmitter . getEmitter ( Events . REFRESH_ALL , [ "panel" , "refreshBtn" ] ) )
12441261 . on ( "click" , ".git-commit" , EventEmitter . getEmitter ( Events . HANDLE_GIT_COMMIT ) )
0 commit comments