[#1484] neofs-cli: Print error on a separate line from a progress bar

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-06-08 10:59:11 +03:00 committed by fyrchik
parent e42b7f6a65
commit 24b4c1ecf4
2 changed files with 5 additions and 5 deletions

View file

@ -89,6 +89,9 @@ func getObject(cmd *cobra.Command, _ []string) {
}
res, err := internalclient.GetObject(prm)
if p != nil {
p.Finish()
}
if err != nil {
if ok := printSplitInfoErr(cmd, err); ok {
return
@ -99,9 +102,6 @@ func getObject(cmd *cobra.Command, _ []string) {
hdrFile := cmd.Flag("header").Value.String()
if filename != "" {
if p != nil {
p.Finish()
}
if hdrFile != "" || !strictOutput(cmd) {
cmd.Printf("[%s] Object successfully saved\n", filename)
}

View file

@ -135,11 +135,11 @@ func putObject(cmd *cobra.Command, _ []string) {
}
res, err := internalclient.PutObject(prm)
common.ExitOnErr(cmd, "rpc error: %w", err)
if p != nil {
p.Finish()
}
common.ExitOnErr(cmd, "rpc error: %w", err)
cmd.Printf("[%s] Object successfully stored\n", filename)
cmd.Printf(" ID: %s\n CID: %s\n", res.ID(), cnr)
}