Skip to content

Commit

Permalink
FAB-2747 only >= 500 should be considered errors
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-2747

Status code < 500 should be endorsed and can be potential
transactions. Note that all fabric errors will be 500 and
fabric system chaincodes return 0, 200 (ie, OK) or 500
(ie, ERROR) unambiguously.

Change-Id: Ia67500624ab29f4aa40125a77a5970a766c6d3d0
Signed-off-by: Srinivasan Muralidharan <muralisr@us.ibm.com>
  • Loading branch information
Srinivasan Muralidharan committed Mar 27, 2017
1 parent 397f5de commit 2373bbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ func (e *Endorser) callChaincode(ctxt context.Context, chainID string, version s
return nil, nil, err
}

if res.Status != shim.OK {
//per doc anything < 500 can be sent as TX.
//fabric errors will always be >= 500 (ie, unambiguous errors )
//"lccc" will respond with status 200 or >=500 (ie, unambiguous OK or ERROR)
//This leaves all < 500 errors to user chaincodes
if res.Status >= shim.ERROR {
return nil, nil, fmt.Errorf(string(res.Message))
}

Expand Down

0 comments on commit 2373bbf

Please sign in to comment.