This repository was archived by the owner on Feb 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ func (cmd *LsCommand) Run() error {
8383 dirPath , err := cmd .path .ToDirPath ()
8484 if err == nil {
8585 dirFS , err := client .Dirs ().GetTree (dirPath .Value (), 1 , false )
86- if err == api .ErrDirNotFound && dirPath .IsRepoPath () {
86+ if api .IsErrNotFound ( err ) && dirPath .IsRepoPath () {
8787 return err
88- } else if err != nil && err != api . ErrDirNotFound {
88+ } else if err != nil && ! isErrNotFound ( err ) {
8989 return err
9090 } else if err == nil {
9191 err = printDir (cmd .io .Stdout (), cmd .quiet , dirFS .RootDir , timeFormatter )
@@ -100,7 +100,7 @@ func (cmd *LsCommand) Run() error {
100100 secretPath , err := cmd .path .ToSecretPath ()
101101 if err == nil {
102102 versions , err := client .Secrets ().Versions ().ListWithoutData (secretPath .Value ())
103- if err == api .ErrSecretNotFound {
103+ if api .IsErrNotFound ( err ) {
104104 return ErrResourceNotFound (cmd .path )
105105 } else if err != nil {
106106 return err
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func (cmd *RmCommand) Run() error {
7171 return ErrCannotRemoveDir
7272 }
7373 return rmDir (client , dirPath , cmd .force , cmd .io )
74- } else if err != api .ErrDirNotFound {
74+ } else if ! api .IsErrNotFound ( err ) {
7575 return err
7676 }
7777 }
@@ -87,7 +87,7 @@ func (cmd *RmCommand) Run() error {
8787
8888 // Check if the secret exists first so we can return a generic error here instead of ErrSecretNotFound.
8989 _ , err = client .Secrets ().Get (secretPath .Value ())
90- if err == api .ErrSecretNotFound {
90+ if api .IsErrNotFound ( err ) {
9191 return ErrResourceNotFound (cmd .path )
9292 }
9393
You can’t perform that action at this time.
0 commit comments