[bitcoin-cli] improve error output#6387
Merged
laanwj merged 1 commit intobitcoin:masterfrom Jul 8, 2015
Merged
Conversation
e7c244c to
9c7d0dd
Compare
Contributor
|
ACK |
Member
There was a problem hiding this comment.
Maybe not print the whole object, when we print the nicely formatted error?
What has always held me back from doing this (sensible) thing is that scripts may be relying on bitcoin-cli's output for errors to be as it is.
Contributor
Author
There was a problem hiding this comment.
This line strPrint = "error: " + error.write(); get's overwritten at L198 when error.isObject() (currently always).
Hmm... if someone relies on a/the output of a RPC client application like bitcoin-cli he should definitively rethink his API design and probably directly use the JSON RPC API.
9c7d0dd to
f3a004a
Compare
f3a004a to
65ce021
Compare
Member
|
Travis error was unrelated (see #6391) |
laanwj
added a commit
that referenced
this pull request
Jul 8, 2015
65ce021 [bitcoin-cli] improve error output (Jonas Schnelli)
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Mar 3, 2017
Bitcoin 0.12 misc PRs 1 Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6198 - bitcoin/bitcoin#6206 - bitcoin/bitcoin#5927 - bitcoin/bitcoin#6213 - bitcoin/bitcoin#6061 - bitcoin/bitcoin#6283 (partial, remainder was pulled in #929) - bitcoin/bitcoin#6272 - bitcoin/bitcoin#6316 - bitcoin/bitcoin#6133 - bitcoin/bitcoin#6387 - bitcoin/bitcoin#6401 - bitcoin/bitcoin#6434 - bitcoin/bitcoin#6372 - bitcoin/bitcoin#6447 - bitcoin/bitcoin#6149 - bitcoin/bitcoin#6468 Part of #2074.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[only affects bitcoin-cli]
At the moment, errors in bitcoin-cli are sent to stderr as compact json string. Example:
This PR would format the error message and error code so that it's better readable. Example after this PR: