File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,13 +113,15 @@ module.exports = {
113113 return container ;
114114 } )
115115 . catch ( ( err ) => {
116- // There's no "deleted" status for container,
117- // so if the container is not found we consider it as deleted and return null
118- if ( err . response . status === 404 ) {
119- return null ;
116+ // toleration on 4XX errors because on some status, for example deleting the API
117+ // will return a 404 err code if item has been deleted.
118+ if ( err . response === undefined ) {
119+ // if we have a raw Error
120+ throw err ;
121+ } else if ( err . response . status >= 500 ) {
122+ // if we have a CustomError, we can check the status
123+ throw new Error ( err ) ;
120124 }
121-
122- throw new Error ( err ) ;
123125 } ) ;
124126 } ,
125127
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ module.exports = {
115115 return func ;
116116 } )
117117 . catch ( ( err ) => {
118- // toleration on 4XX errors because on some status, for exemple deleting the API
118+ // toleration on 4XX errors because on some status, for example deleting the API
119119 // will return a 404 err code if item has been deleted.
120120 if ( err . response === undefined ) {
121121 // if we have a raw Error
You can’t perform that action at this time.
0 commit comments