Skip to content

Commit

Permalink
Merge "[FAB-11468] Print error upon peer cmd failure"
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rWin authored and Gerrit Code Review committed Aug 4, 2018
2 parents 63e90ec + 8896069 commit fb01cc7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion peer/channel/getinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (cc *endorserClient) getBlockChainInfo() (*cb.BlockchainInfo, error) {
}

if proposalResp.Response == nil || proposalResp.Response.Status != 200 {
return nil, errors.Errorf("received bad response, status %d", proposalResp.Response.Status)
return nil, errors.Errorf("received bad response, status %d: %s", proposalResp.Response.Status, proposalResp.Response.Message)
}

blockChainInfo := &cb.BlockchainInfo{}
Expand Down
2 changes: 1 addition & 1 deletion peer/channel/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func executeJoin(cf *ChannelCmdFactory) (err error) {
}

if proposalResp.Response.Status != 0 && proposalResp.Response.Status != 200 {
return ProposalFailedErr(fmt.Sprintf("bad proposal response %d", proposalResp.Response.Status))
return ProposalFailedErr(fmt.Sprintf("bad proposal response %d: %s", proposalResp.Response.Status, proposalResp.Response.Message))
}
logger.Info("Successfully submitted proposal to join channel")
return nil
Expand Down
2 changes: 1 addition & 1 deletion peer/channel/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (cc *endorserClient) getChannels() ([]*pb.ChannelInfo, error) {
}

if proposalResp.Response == nil || proposalResp.Response.Status != 200 {
return nil, errors.New(fmt.Sprint("Received bad response, status", proposalResp.Response.Status))
return nil, errors.New(fmt.Sprintf("Received bad response, status %d: %s", proposalResp.Response.Status, proposalResp.Response.Message))
}

var channelQueryResponse pb.ChannelQueryResponse
Expand Down
2 changes: 1 addition & 1 deletion peer/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func GetOrdererEndpointOfChain(chainID string, signer msp.SigningIdentity, endor
}

if proposalResp.Response.Status != 0 && proposalResp.Response.Status != 200 {
return nil, errors.Errorf("error bad proposal response %d", proposalResp.Response.Status)
return nil, errors.Errorf("error bad proposal response %d: %s", proposalResp.Response.Status, proposalResp.Response.Message)
}

// parse config block
Expand Down

0 comments on commit fb01cc7

Please sign in to comment.