You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the error message returned from the chaincode is encoded and cannot be displayed correctly in Chinese when running the peer's command. The error message looks correct in the server-debug log but when querying through the peer, it returns a decoding error.
The problem could be with the way the error message is presented in the CLI invocation. The line generating the error message could be the cause of the issue, which is located at
Description
It seems like the error message returned from the chaincode is encoded and cannot be displayed correctly in Chinese when running the peer's command. The error message looks correct in the server-debug log but when querying through the peer, it returns a decoding error.
The problem could be with the way the error message is presented in the CLI invocation. The line generating the error message could be the cause of the issue, which is located at
fabric/internal/peer/chaincode/common.go
Line 157 in aaf9932
One possible solution to this problem is to use proto.MarshalTextString to insert the protocol buffer response message into the error string. More information about using proto.MarshalTextString can be found at https://pkg.go.dev/github.com/golang/protobuf@v1.5.3/proto#MarshalTextString.
Steps to reproduce
follow the docs to this,
https://github.com/hyperledger/fabric-samples/blob/main/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started.md?plain=1#L316
and modify the string into
抱歉,资产 ${id} 尚未创建
in https://github.com/hyperledger/fabric-samples/blob/main/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/src/assetTransfer.ts#L54then can see in sever-debug log
and in org1admin log
the right message should be
The text was updated successfully, but these errors were encountered: