Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 2097f8d

Browse files
Improve logging of connection errors (#5955)
* 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 <me@wyatt.email>
1 parent b4d1272 commit 2097f8d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,7 @@ Released with 1.0.0-beta.37 code base.
662662
- Updated dependencies (#5885)
663663

664664
## [Unreleased]
665+
666+
### Fixed
667+
668+
- Improved the error propagation in `web3-providers-http` package to effectively propagate useful error infomation about failed HTTP connections (#5955)

packages/web3-providers-http/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ HttpProvider.prototype.send = function (payload, callback) {
154154
callback(errors.ConnectionTimeout(this.timeout));
155155
}
156156

157-
callback(errors.InvalidConnection(this.host));
157+
callback(errors.InvalidConnection(this.host, error));
158158
}
159159

160160
fetch(this.host, options)

0 commit comments

Comments
 (0)