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
The Fabric Gateway client API v1.10.0 provides some ease-of-use
enhancements to make error details returned from the peer more
accessible for Go client applications. This change updates the tutorial
content to reflect the simplified client-side code and improved output.
Signed-off-by: Mark S. Lewis <[email protected]>
fmt.Printf("Endorse error for transaction %s with gRPC status %v: %s\n", endorseErr.TransactionID, status.Code(endorseErr), endorseErr)
862
-
} else if errors.As(err, &submitErr) {
863
-
fmt.Printf("Submit error for transaction %s with gRPC status %v: %s\n", submitErr.TransactionID, status.Code(submitErr), submitErr)
864
-
} else if errors.As(err, &commitStatusErr) {
865
-
if errors.Is(err, context.DeadlineExceeded) {
866
-
fmt.Printf("Timeout waiting for transaction %s commit status: %s", commitStatusErr.TransactionID, commitStatusErr)
867
-
} else {
868
-
fmt.Printf("Error obtaining commit status for transaction %s with gRPC status %v: %s\n", commitStatusErr.TransactionID, status.Code(commitStatusErr), commitStatusErr)
869
-
}
870
-
} else if errors.As(err, &commitErr) {
871
-
fmt.Printf("Transaction %s failed to commit with status %d: %s\n", commitErr.TransactionID, int32(commitErr.Code), err)
872
-
} else {
873
-
panic(fmt.Errorf("unexpected error type %T: %w", err, err))
fmt.Printf("Timeout waiting for transaction %s commit status: %s\n", commitStatusErr.TransactionID, commitStatusErr)
861
+
} else {
862
+
fmt.Printf("Error obtaining commit status for transaction %s with gRPC status %v: %s\n", commitStatusErr.TransactionID, status.Code(commitStatusErr), commitStatusErr)
863
+
}
864
+
} else if errors.As(err, &transactionErr) {
865
+
// The error could be an EndorseError, SubmitError or CommitError.
Endorse error for transaction 0a0bf1af9c53e0621d6dc98217fb882e0c6d5e174dc1a45f5cb4e07580528347 with gRPC status Aborted: rpc error: code = Aborted desc = failed to endorse transaction, see attached details for more info
936
-
Error Details:
937
-
- address: peer0.org1.example.com:7051; mspId: Org1MSP; message: chaincode response 500, the asset asset70 does not exist
917
+
endorse error: rpc error: code = Aborted desc = failed to endorse transaction, see attached details for more info
918
+
Details:
919
+
- Address: peer0.org1.example.com:7051
920
+
MspId: Org1MSP
921
+
Message: chaincode response 500, the asset asset70 does not exist
0 commit comments