web3.js
web3.js copied to clipboard
Improve error handling on empty provider url
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)
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.
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.
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.
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.