Closed deeptiraom closed 2 years ago
I am trying to fetch the nested exception in the client sdk but its not present:
Hi @deeptiraom, the chaincode SDK deliberately does not return stack traces with the cause to client applications to avoid leaking potentially sensitive information. Chaincode implementations should use ChaincodeException to provide application level error information to the client SDK.
There's an example of handling errors such as the sample asset not found in the REST sample which may be useful... https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/rest-api-typescript/src/errors.ts
Its observed that the fabric-chaincode-shim throws ContractException in case of exception in Chaincode however it needs to return the actual cause nested / wrapped inside the chaincode exception. This is required to fetch the nested exception which is the actual cause in the client sdk adapter when used to run marvin