Skip to content

Commit

Permalink
[FAB-5359] Add BroadcastResponse info to proto
Browse files Browse the repository at this point in the history
The BroadcastResponse proto currently only returns a single status
field.  This was of course intentional, as clients should be utilizing
the status field for any programatic decisions, such as retrying or not.

However, from a usability perspective, diagnosing user error from only a
status code can be quite difficult.  Was the request bad because the
message was malformed, or because it attempted an illegal operation?

This CR simply adds a new proto field named 'info', to the
BroadcastResponse proto.  This info field is a string which may be
populated with human readable text.

There is no guarantees made about the stability of this text (the error
text may change from version to version), and clients should continue to
utilize the status field for any programatic decisions.

Although this is a proto change, it is both forwards and backwards
compatible.  v1.0.x clients will be able to receive BroadcastResponses
made by a v1.1.x server, and v1.1.x clients will see an unpopulated info
field from v1.0.x servers.

Change-Id: Ie4f227285454fab1b6794eaacdaefa42549fff23
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Jul 27, 2017
1 parent 4b6a492 commit d18601e
Showing 2 changed files with 46 additions and 32 deletions.
75 changes: 43 additions & 32 deletions protos/orderer/ab.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions protos/orderer/ab.proto
Original file line number Diff line number Diff line change
@@ -24,7 +24,10 @@ option java_package = "org.hyperledger.fabric.protos.orderer";
package orderer;

message BroadcastResponse {
// Status code, which may be used to programatically respond to success/failure
common.Status status = 1;
// Info string which may contain additional information about the status returned
string info = 2;
}

message SeekNewest { }

0 comments on commit d18601e

Please sign in to comment.