Topics

Issue in Fabric SDK Node 1.2.2 - error response status thrown away #fabric #fabric-sdk-node

Matúš Kempa <matus.kempa@...>
 

Hello,

In Fabric SDK Node 1.2.2, when response with Status less than 400 is returned from chaincode, the resulting response contains only error message and stack trace.

Would it be possible to fix this issue for 1.2 the same way as it is in 1.3?
Please note, that it is necessary for us to work with Fabric docker images 1.2.

The problematic line in: https://github.com/hyperledger/fabric-sdk-node/blob/release-1.2/fabric-client/lib/Peer.js
114: reject(new Error(proposalResponse.response.message));

Proposed changes: as in https://github.com/hyperledger/fabric-sdk-node/blob/release-1.3/fabric-client/lib/Peer.js
on lines 123, 124 and 125

Thank you.

Gari Singh
 

Just to double check here ... you actually are talking about the behavior when the status is >= 400, correct?


-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain
IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: fabric@...
From: "Matúš Kempa"
Sent by: fabric@...
Date: 10/16/2018 06:18AM
Subject: [Hyperledger Fabric] Issue in Fabric SDK Node 1.2.2 - error response status thrown away #fabric #fabric-sdk-node

Hello,

In Fabric SDK Node 1.2.2, when response with Status less than 400 is returned from chaincode, the resulting response contains only error message and stack trace.

Would it be possible to fix this issue for 1.2 the same way as it is in 1.3?
Please note, that it is necessary for us to work with Fabric docker images 1.2.

The problematic line in: https://github.com/hyperledger/fabric-sdk-node/blob/release-1.2/fabric-client/lib/Peer.js
114: reject(new Error(proposalResponse.response.message));

Proposed changes: as in https://github.com/hyperledger/fabric-sdk-node/blob/release-1.3/fabric-client/lib/Peer.js
on lines 123, 124 and 125

Thank you.