web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Improve error handling on empty provider url

Open GregTheGreek opened this issue 2 years ago • 4 comments

This is not a Bug Report, Feature Request, or related to Documentation

  • [X] I have searched the existing issues

Is there an existing issue for this?

  • [X] I have searched the existing issues

What's up?

When instantiating the default web3 package, if the provider string is empty the error could be more verbose, eg: "No provider url supplied"

Examples/References

Input

import {Web3} from "web3";

const web3 = new Web3("");

Error

➜ node index.js
Default export [class Web3 extends Web3Context]
/[...]/web3js-4x-testing/web3.js-4x/packages/web3-common/dist/errors.js:109
        super(...arguments);
        ^

ProviderError: Provider not available
    at new ProviderError (/[...]/web3js-4x-testing/web3.js-4x/packages/web3-common/dist/errors.js:109:9)

GregTheGreek avatar Apr 26 '22 19:04 GregTheGreek

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Jun 26 '22 00:06 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Oct 25 '22 00:10 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Jan 01 '23 00:01 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Mar 04 '23 00:03 github-actions[bot]