Skip to content

Commit

Permalink
Merge pull request #24 from web-of-things-open-source/fix/push-folder…
Browse files Browse the repository at this point in the history
…-err

fix: add filename to error message on push fail where missing
  • Loading branch information
alexbrdn authored Nov 28, 2023
2 parents a89ad93 + 719886e commit ed38655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/app/cli/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ func pushFile(filename string, remote remotes.Remote, optPath string) (PushResul
_, raw, err := internal.ReadRequiredFile(filename)
if err != nil {
Stderrf("Couldn't read file %s: %v", filename, err)
return PushResult{PushErr, err.Error()}, err
return PushResult{PushErr, fmt.Sprintf("error pushing file %s: %s", filename, err.Error())}, err
}
id, err := commands.PushFile(raw, remote, optPath)
if err != nil {
var errExists *remotes.ErrTMExists
if errors.As(err, &errExists) {
return PushResult{TMExists, fmt.Sprintf("file %s already exists as %s", filename, id.String())}, nil
}
return PushResult{PushErr, err.Error()}, err
return PushResult{PushErr, fmt.Sprintf("error pushing file %s: %s", filename, err.Error())}, err
}

return PushResult{PushOK, fmt.Sprintf("file %s pushed as %s", filename, id.String())}, nil
Expand Down

0 comments on commit ed38655

Please sign in to comment.