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

Strange error when entering random cw20 #89

Open
mikedotexe opened this issue Apr 8, 2022 · 0 comments
Open

Strange error when entering random cw20 #89

mikedotexe opened this issue Apr 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@mikedotexe
Copy link
Collaborator

When entering a non-existent cw20 shown like the screenshot below, I was expecting it to say:

No contract at that address. Probable black hole.

because of this part:

const getTokenDetails = async ({tokenAddress, network}) => {
  console.log('aloha to of getTokenDetails')
  let tokenDetails;
  const tokenType = await getTokenType(tokenAddress);
  try {
    tokenDetails = await tokenType.getTokenDetails({tokenAddress, network});
  } catch (e) {
    // Throw a more specific error message if we can
    if (e.message.includes('decoding bech32 failed')) {
      throw 'Invalid address. Remember: first you copy, then you paste.';
    } else if (e.message.includes('contract: not found')) {
      throw 'No contract at that address. Probable black hole.';
    } else if (e.message.includes('Error parsing into type')) {
      throw 'That is a valid contract, but cosmic perturbations tell us it is not a cw20.';
    } else {
      console.warn(e.stack);
      throw `Error message after trying to query ${tokenType.name}: ${e.message}`;
    }

Screen Shot 2022-04-08 at 2 26 16 PM

@mikedotexe mikedotexe added the enhancement New feature or request label Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant