Skip to content

Commit

Permalink
Improve logging of connection errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clydedcruz authored Mar 24, 2023
1 parent 46d414b commit f771aa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ HttpProvider.prototype.send = function (payload, callback) {
callback(errors.ConnectionTimeout(this.timeout));
}

callback(errors.InvalidConnection(this.host));
callback(errors.InvalidConnection(this.host, error));
}

fetch(this.host, options)
Expand Down

0 comments on commit f771aa7

Please sign in to comment.