Return errors to client via jsonrpc #1361
Merged
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.
Before this patch, the client could not tell the difference between a transaction that's been seen by the network, and one that failed because of a bug in its program. With this patch, the client can detect if the transaction was not seen, whether it succeed, or how the the transaction failed. Missing bits of information that still exist:
Also updated the test about potentially desirable behavior (cc #1157). The only part that's undesirable now is that the bank isn't taking the fee when it knows the transaction's program failed. It should.
One thing I don't like about this PR is that it shares too much information with the client. jsonrpc should probably define a separate error structure similar to BankError and maintain backward compatibility.
Fixes #1298