@@ -122,7 +122,7 @@ define(function (require, exports) {
122122 $this . prop ( "disabled" , true ) . attr ( "title" , "Already fetched" ) ;
123123 _reloadBranchSelect ( $select , branches ) ;
124124 } ) ;
125- } ) . fail ( function ( err ) {
125+ } ) . catch ( function ( err ) {
126126 throw ErrorHandler . showError ( err , "Fetching remote information failed" ) ;
127127 } ) ;
128128 } ) ;
@@ -138,7 +138,7 @@ define(function (require, exports) {
138138 isRemote = $option . attr ( "remote" ) ,
139139 track = ! ! isRemote ;
140140
141- Main . gitControl . createBranch ( branchName , originName , track ) . fail ( function ( err ) {
141+ Main . gitControl . createBranch ( branchName , originName , track ) . catch ( function ( err ) {
142142 ErrorHandler . showError ( err , "Creating new branch failed" ) ;
143143 } ) . then ( function ( ) {
144144 closeDropdown ( ) ;
@@ -152,7 +152,7 @@ define(function (require, exports) {
152152 } ) . on ( "click" , "a.git-branch-link .switch-branch" , function ( e ) {
153153 e . stopPropagation ( ) ;
154154 var branchName = $ ( this ) . parent ( ) . data ( "branch" ) ;
155- Main . gitControl . checkoutBranch ( branchName ) . fail ( function ( err ) {
155+ Main . gitControl . checkoutBranch ( branchName ) . catch ( function ( err ) {
156156 ErrorHandler . showError ( err , "Switching branches failed" ) ;
157157 } ) . then ( function ( ) {
158158 closeDropdown ( ) ;
@@ -164,9 +164,9 @@ define(function (require, exports) {
164164 } ) . on ( "mouseleave" , "a" , function ( ) {
165165 $ ( this ) . removeClass ( "selected" ) ;
166166 } ) . on ( "click" , "a.git-branch-link .trash-icon" , function ( ) {
167- Main . gitControl . deleteLocalBranch ( $ ( this ) . parent ( ) . data ( "branch" ) )
168- . fail ( function ( err ) { ErrorHandler . showError ( err , "Branch deletion failed" ) ; } ) ;
169- $ ( this ) . parent ( ) . remove ( ) ;
167+ Main . gitControl . deleteLocalBranch ( $ ( this ) . parent ( ) . data ( "branch" ) ) . catch ( function ( err ) {
168+ ErrorHandler . showError ( err , "Branch deletion failed" ) ;
169+ } ) ;
170170 } ) . on ( "click" , ".merge-branch" , function ( ) {
171171 var fromBranch = $ ( this ) . parent ( ) . data ( "branch" ) ;
172172 doMerge ( fromBranch ) ;
@@ -203,7 +203,7 @@ define(function (require, exports) {
203203
204204 Menus . closeAll ( ) ;
205205
206- Git . getBranches ( ) . fail ( function ( err ) {
206+ Git . getBranches ( ) . catch ( function ( err ) {
207207 ErrorHandler . showError ( err , "Getting branch list failed" ) ;
208208 } ) . then ( function ( branches ) {
209209 branches = branches . reduce ( function ( arr , branch ) {
@@ -262,7 +262,7 @@ define(function (require, exports) {
262262 . on ( "click" , toggleDropdown )
263263 . append ( $ ( "<span class='dropdown-arrow' />" ) ) ;
264264 Panel . enable ( ) ;
265- } ) . fail ( function ( ex ) {
265+ } ) . catch ( function ( ex ) {
266266 if ( ErrorHandler . contains ( ex , "unknown revision" ) ) {
267267 $gitBranchName
268268 . off ( "click" )
@@ -272,7 +272,7 @@ define(function (require, exports) {
272272 throw ex ;
273273 }
274274 } ) ;
275- } ) . fail ( function ( err ) {
275+ } ) . catch ( function ( err ) {
276276 throw ErrorHandler . showError ( err ) ;
277277 } ) ;
278278 }
0 commit comments