Skip to content

Commit

Permalink
[FAB-3694] Fix error handling in peer channel cmd
Browse files Browse the repository at this point in the history
* Remove unused error checking.
* Add error string to the return result.

Change-Id: Iabcdf693c9e130aa63a5ce769e6160fda0033c0b
Signed-off-by: Baohua Yang <baohyang@cn.ibm.com>
  • Loading branch information
yeasy committed May 7, 2017
1 parent f5987e2 commit 2d96232
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions peer/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ func InitCmdFactory(isOrdererRequired bool) (*ChannelCmdFactory, error) {
return common.GetBroadcastClient(orderingEndpoint, tls, caFile)
}

if err != nil {
return nil, fmt.Errorf("Error getting broadcast client: %s", err)
}

//for join, we need the endorser as well
if isOrdererRequired {
cmdFact.EndorserClient, err = common.GetEndorserClient()
Expand Down
2 changes: 1 addition & 1 deletion peer/channel/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func sendCreateChainTransaction(cf *ChannelCmdFactory) error {
var broadcastClient common.BroadcastClient
broadcastClient, err = cf.BroadcastFactory()
if err != nil {
return err
return fmt.Errorf("Error getting broadcast client: %s", err)
}

defer broadcastClient.Close()
Expand Down

0 comments on commit 2d96232

Please sign in to comment.