Skip to content

Error Handling

Matthew B White edited this page Aug 19, 2021 · 3 revisions

From the chaincode perspective:

Node.js shows simply how the response to the peer is encoded.

   type: fabprotos.protos.ChaincodeMessage.Type.ERROR,
   payload: msg.payload,
   txid: msg.txid,
   channel_id : msg.channel_id
``

There is some variance on what the format of the payload is, and what the circumstances are that the type is chosen to be to either ERROR or COMPLETED


The payload format is not typed, but is often the the `Response` structure.
```protobuf
// A response with a representation similar to an HTTP response that can
// be used within another message.
message Response {
    // A status code that should follow the HTTP status codes.
    int32 status = 1;


    // A message associated with the response code.
    string message = 2;


    // A payload that can be used to include metadata with this response.
    bytes payload = 3;
}

// A response with a representation similar to an HTTP response that can // be used within another message. message Response {     // A status code that should follow the HTTP status codes.     int32 status = 1;

    // A message associated with the response code.     string message = 2;

    // A payload that can be used to include metadata with this response.     bytes payload = 3; }

(CM = chaincode message.type

go

java

node

Tx invoked success

CM=COMPLETED

CM=COMPLETED

CM=COMPLETED

Clone this wiki locally