Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Updated error message for undefined network to include the name of th…
Browse files Browse the repository at this point in the history
…e network that was passed (#1057)
  • Loading branch information
SoonNear authored Mar 21, 2023
1 parent 4649d5e commit 47e6561
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/inspect-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const checkForAccDoesNotExist = (error, options) => {
// below is optional approach, but "alias" in command options is better
// const accountId = (options.accountId)? options.accountId : options.contractName;
const currentNetwork = config.helperAccount;
console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${suffixesToNetworks[currentNetwork]}}\n}`);
if (currentNetwork in suffixesToNetworks) {
console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${suffixesToNetworks[currentNetwork]}}\n}`);
}
else {
console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in an undefined network: {bold.white ${currentNetwork}}\n}`);
}

const accSuffix = String(options.accountId).match('[^.]*$')[0];
const accNetwork = suffixesToNetworks[accSuffix];
Expand Down

0 comments on commit 47e6561

Please sign in to comment.