Skip to content

Commit 2373bbf

Browse files
author
Srinivasan Muralidharan
committed
FAB-2747 only >= 500 should be considered errors
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 <[email protected]>
1 parent 397f5de commit 2373bbf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/endorser/endorser.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ func (e *Endorser) callChaincode(ctxt context.Context, chainID string, version s
137137
return nil, nil, err
138138
}
139139

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

0 commit comments

Comments
 (0)