Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #536 Update error messages for 'caliper-ethereum' package #1363

Merged
merged 5 commits into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/caliper-ethereum/lib/ethereum-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ class EthereumConnector extends ConnectorBase {
try {
if (privacy) {
contractInstance = await self.deployPrivateContract(contractData, privacy);
logger.info('Deployed private contract ' + contractData.name + ' at ' + contractInstance.options.address);
logger.info(`Deployed private contract ${contractData.name} at ${contractInstance.options.address}`);
} else {
contractInstance = await self.deployContract(contractData);
logger.info('Deployed contract ' + contractData.name + ' at ' + contractInstance.options.address);
logger.info(`Deployed contract ${contractData.name} at ${contractInstance.options.address}`);
}
} catch (err) {
reject(err);
Expand Down Expand Up @@ -244,7 +244,7 @@ class EthereumConnector extends ConnectorBase {

const onFailure = (err) => {
status.SetStatusFail();
logger.error('Failed tx on ' + request.contract + ' calling method ' + request.verb + ' nonce ' + params.nonce);
logger.error(`Failed tx on ${request.contract}; calling method: ${request.verb}; nonce: ${params.nonce}`);
logger.error(err);
};

Expand Down Expand Up @@ -302,7 +302,7 @@ class EthereumConnector extends ConnectorBase {

const onFailure = (err) => {
status.SetStatusFail();
logger.error('Failed private tx on ' + request.contract + ' calling method ' + request.verb + ' private nonce ' + 0);
logger.error(`Failed private tx on ${request.contract}; calling method: ${request.verb}; private nonce: ` + 0);
logger.error(err);
};

Expand Down Expand Up @@ -402,8 +402,9 @@ class EthereumConnector extends ConnectorBase {
if (txRcpt.status === '0x1') {
return new web3.eth.Contract(contractData.abi, txRcpt.contractAddress);
} else {
logger.error('Failed private transaction hash ' + txHash);
throw new Error('Failed private transaction hash ' + txHash);
const msg = `Failed private transaction hash ${txHash}`;
logger.error(msg);
throw new Error(msg);
}
} catch (err) {
logger.error('Error deploying private contract: ', JSON.stringify(err));
Expand Down Expand Up @@ -441,7 +442,7 @@ class EthereumConnector extends ConnectorBase {
return el.type === 'LEGACY';
})[0].privacyGroupId;
} else {
throw new Error('Multiple legacy privacy groups with same members. Can\'t resolve privacyGroupId.');
throw new Error('There are multiple legacy privacy groups with same members. Can\'t resolve privacyGroupId.');
}
}
case 'pantheon':
Expand Down