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

The real error during http connections is gobbled up and only a generic message is printed #5954

Closed
1 task done
clydedacruz opened this issue Mar 24, 2023 · 1 comment
Closed
1 task done
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@clydedacruz
Copy link

clydedacruz commented Mar 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Error: CONNECTION ERROR: Couldn't connect to node https://192.168.200.200:30041.
   at Object.ConnectionError (/somedapp/node_modules/web3-core-helpers/lib/errors.js:66:23)
   at Object.InvalidConnection (/somedapp/node_modules/web3-core-helpers/lib/errors.js:36:21)
   at HttpProvider.failed (/somedapp/node_modules/web3-providers-http/lib/index.js:139:25)
   at processTicksAndRejections (node:internal/process/task_queues:96:5)

Expected Behavior

Error: CONNECTION ERROR: Couldn't connect to node FetchError: request to https://192.168.200.200:30041/ failed, reason: connect ECONNREFUSED 192.168.200.200:30041.
    at Object.ConnectionError (/somedapp/node_modules/web3-core-helpers/lib/errors.js:66:23)
    at Object.InvalidConnection (/somedapp/node_modules/web3-core-helpers/lib/errors.js:36:21)
    at HttpProvider.failed (/somedapp/node_modules/web3-providers-http/lib/index.js:140:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Steps to Reproduce

Try using https://github.com/web3/web3.js/tree/1.x/packages/web3-providers-http with a URL that is down or with a JSON RPC endpoint that uses a self signed certificate.

Web3.js Version

1.8.2

Environment

  • Operating System: Ubuntu 20.04
  • Browser: NA
  • Node.js Version: 16.18.0
  • NPM Version: 8.19.2

Anything Else?

No response

@clydedacruz clydedacruz added the Bug Addressing a bug label Mar 24, 2023
clydedacruz pushed a commit to clydedacruz/web3.js that referenced this issue Mar 24, 2023
Fixes. web3#5954

Existing code gobbles up the real error and only prints a generic message with the URL. This change utilizes the error object to give a better indication of what failed with the connection.
@mconnelly8 mconnelly8 added the 1.x 1.0 related issues label Mar 28, 2023
spacesailor24 added a commit that referenced this issue Mar 31, 2023
* Improve logging of connection errors

Fixes. #5954

Existing code gobbles up the real error and only prints a generic message with the URL. This change utilizes the error object to give a better indication of what failed with the connection.

* Updated CHANGELOG

* Fix PR number in Changelog

---------

Co-authored-by: Wyatt Barnes <[email protected]>
@mconnelly8
Copy link

PR was merged. Can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

2 participants