How can I get chaincode error message? #535
-
I wrote a chaincode that includes an add operation and returns an error if the "Id" already exists. When using the gateway-api, the Proposal's Endorse method returns an error message, but it is not the error message returned by the chaincode. How can I get the error message from the chaincode?
How can I get "the asset id4 already exists" message? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have you unpacked the 'Details' field of the returned error? An example of how to do that can be seen here: |
Beta Was this translation helpful? Give feedback.
Have you unpacked the 'Details' field of the returned error? An example of how to do that can be seen here:
https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/application-gateway-go/assetTransfer.go#L255