From bd77bba6766ca7097b9375ce7a93f3c122e76e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 23 Oct 2019 12:42:52 +0200 Subject: [PATCH] on chain deals: Improve some errors --- chain/deals/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chain/deals/client.go b/chain/deals/client.go index caa47c3ce..ac3d5d54c 100644 --- a/chain/deals/client.go +++ b/chain/deals/client.go @@ -180,23 +180,23 @@ func (c *Client) Start(ctx context.Context, p ClientDealProposal) (cid.Cid, erro } if err := api.SignWith(ctx, c.w.Sign, p.Client, &proposal); err != nil { - return cid.Undef, err + return cid.Undef, xerrors.Errorf("signing deal proposal failed: %w", err) } proposalNd, err := cborrpc.AsIpld(proposal) if err != nil { - return cid.Undef, err + return cid.Undef, xerrors.Errorf("getting proposal node failed: %w", err) } s, err := c.h.NewStream(ctx, p.MinerID, DealProtocolID) if err != nil { s.Reset() - return cid.Undef, err + return cid.Undef, xerrors.Errorf("connecting to storage provider failed: %w", err) } if err := cborrpc.WriteCborRPC(s, proposal); err != nil { s.Reset() - return cid.Undef, err + return cid.Undef, xerrors.Errorf("sending proposal to storage provider failed: %w", err) } deal := ClientDeal{