diff --git a/api/test/deals.go b/api/test/deals.go index 5b5f04e41..289445083 100644 --- a/api/test/deals.go +++ b/api/test/deals.go @@ -400,8 +400,8 @@ func testRetrieval(t *testing.T, ctx context.Context, err error, client *impl.Fu } updates, err := client.ClientRetrieve(ctx, offers[0].Order(caddr), ref) for update := range updates { - if update.Err != nil { - t.Fatalf("%+v", err) + if update.Err != "" { + t.Fatalf("%v", err) } } diff --git a/cli/client.go b/cli/client.go index 5c2574364..5bc0f4a0d 100644 --- a/cli/client.go +++ b/cli/client.go @@ -846,12 +846,11 @@ var clientRetrieveCmd = &cli.Command{ for { select { case evt, chOpen := <-updates: - - fmt.Printf("Retrieval Event: %s, State: %s, BytesReceived: %d, PaymentSent: %s\n", + fmt.Printf("> Recv: %s, Paid %s, %s (%s)\n", + types.SizeStr(types.NewInt(evt.BytesReceived)), + types.FIL(evt.FundsSpent), retrievalmarket.ClientEvents[evt.Event], retrievalmarket.DealStatuses[evt.Status], - evt.BytesReceived, - evt.FundsSpent.String(), ) if !chOpen { @@ -859,8 +858,8 @@ var clientRetrieveCmd = &cli.Command{ return nil } - if evt.Err != nil { - return xerrors.Errorf("retrieval failed: %w", err) + if evt.Err != "" { + return xerrors.Errorf("retrieval failed: %v", err) } case <-ctx.Done(): return xerrors.Errorf("retrieval timed out") diff --git a/markets/loggers/loggers.go b/markets/loggers/loggers.go index 58dc6d97d..6f386dbba 100644 --- a/markets/loggers/loggers.go +++ b/markets/loggers/loggers.go @@ -34,5 +34,5 @@ type RetrievalEvent struct { Status retrievalmarket.DealStatus BytesReceived uint64 FundsSpent abi.TokenAmount - Err error + Err string } diff --git a/node/impl/client/client.go b/node/impl/client/client.go index befcae0b1..2823ca263 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -410,7 +410,11 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref defer close(events) finish := func(e error) { - events <- marketevents.RetrievalEvent{Err: e} + errStr := "" + if e != nil { + errStr = e.Error() + } + events <- marketevents.RetrievalEvent{Err: errStr} } if order.MinerPeer.ID == "" {