Skip to content

Commit

Permalink
retry for smart contract error
Browse files Browse the repository at this point in the history
Signed-off-by: selvaprakash92 <[email protected]>
  • Loading branch information
selvaprakash92 committed Jun 30, 2023
1 parent a6323cc commit dc96138
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/apollo/src/rest/PeerRestApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,18 @@ class PeerRestApi {
if (error.grpc_resp.statusMessage.indexOf('successfully installed') !== -1) {
Log.info(`smart contract already installed on peer "${peer.display_name}"`);
return {};
} else {
} else if (error.grpc_resp.statusMessage.indexOf('???') === 10) {
try {
const lc_installChaincode = v2_lifecycle ? promisify(window.stitch.lc_installChaincode) : promisify(window.stitch.installChaincode);
const installChaincode = await lc_installChaincode(opts);
return installChaincode.data;
}
catch (error) {
Log.error(error);
throw error;
}
}
else {
throw error;
}
}
Expand Down

0 comments on commit dc96138

Please sign in to comment.