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

bitcoin-cli: More detailed error reporting #8722

Merged
merged 1 commit into from
Sep 26, 2016

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Sep 14, 2016

Register a evhttp error handler to get a more detailed error message if the HTTP request fails. This can save a lot of confusion, distinguishing between, say, timeouts and being unable to connect and HTTP header issues.

Only works for libevent >= 2.1.3.

The rationale for this was to be able to debug the zu issue leading to #8730. Without this, there is no way to distinguish a refused connection from a HTTP parsing isue.

@jonasschnelli
Copy link
Contributor

jonasschnelli commented Sep 14, 2016

utACK but looks like your are using functions not available in the libevent version travis compiles against (evhttp_request_error) https://travis-ci.org/bitcoin/bitcoin/jobs/159869918#L1081

@laanwj
Copy link
Member Author

laanwj commented Sep 14, 2016

Somehow I was afraid of that, all of the useful stuff in libevent is in the alpha/beta branch these days... deja vu to #7759.

@laanwj
Copy link
Member Author

laanwj commented Sep 14, 2016

I've guarded the uses of evhttp error with LIBEVENT_VERSION_NUMBER >= 0x02010300. This is the version it was introduced in according to git history. On older versions it will always print unknown error.

Register a evhttp error handler to get a more detailed error message
if the HTTP request fails.
@laanwj
Copy link
Member Author

laanwj commented Sep 21, 2016

Ok I've slightly tweaked the error messages and rebased. This should be ready to go.

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@laanwj laanwj merged commit 381826d into bitcoin:master Sep 26, 2016
laanwj added a commit that referenced this pull request Sep 26, 2016
381826d bitcoin-cli: More detailed error reporting (Wladimir J. van der Laan)
@fanquake fanquake mentioned this pull request Oct 3, 2016
codablock pushed a commit to codablock/dash that referenced this pull request Jan 11, 2018
381826d bitcoin-cli: More detailed error reporting (Wladimir J. van der Laan)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
381826d bitcoin-cli: More detailed error reporting (Wladimir J. van der Laan)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants