fix success handling in retreival

This commit is contained in:
aarshkshah1992 2021-03-31 09:44:53 +05:30 committed by Łukasz Magiera
parent 0244dfd76c
commit 8733cea902

View File

@ -1195,14 +1195,21 @@ var clientRetrieveCmd = &cli.Command{
retrievalmarket.ClientEvents[evt.Event],
retrievalmarket.DealStatuses[evt.Status],
)
} else {
afmt.Println("Success")
return nil
}
if evt.Err != "" {
return xerrors.Errorf("retrieval failed: %s", evt.Err)
}
if !ok {
if evt.Status == retrievalmarket.DealStatusCompleted {
afmt.Println("Success")
return nil
}
return xerrors.Errorf("saw final deal state %s instead of expected state DealStatusCompleted", retrievalmarket.DealStatuses[evt.Status])
}
case <-ctx.Done():
return xerrors.Errorf("retrieval timed out")
}