aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/protocol.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-02-24 11:23:38 -0500
committerJohn Newbery <john@johnnewbery.com>2017-03-08 14:22:55 -0500
commit338bf065a454fee76d9dfa9c7a36161cac72309f (patch)
treeec60155b6fd8c7fc92010e01b7419c8159cc36cf /src/rpc/protocol.h
parentdab804c18a427901684ebe936b2069a97e04a268 (diff)
downloadbitcoin-338bf065a454fee76d9dfa9c7a36161cac72309f.tar.xz
Add commenting around JSON error codes
RPC_INVALID_REQUEST and RPC_METHOD_NOT_FOUND are mapped internally to HTTP error codes and should not be used for application-layer errors. This commit adds commenting around those definitions to warn not to use them for application errors.
Diffstat (limited to 'src/rpc/protocol.h')
-rw-r--r--src/rpc/protocol.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rpc/protocol.h b/src/rpc/protocol.h
index 47e56e712b..eafb8d9e67 100644
--- a/src/rpc/protocol.h
+++ b/src/rpc/protocol.h
@@ -31,9 +31,15 @@ enum HTTPStatusCode
enum RPCErrorCode
{
//! Standard JSON-RPC 2.0 errors
+ // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
+ // It should not be used for application-layer errors.
RPC_INVALID_REQUEST = -32600,
+ // RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOUND (404).
+ // It should not be used for application-layer errors.
RPC_METHOD_NOT_FOUND = -32601,
RPC_INVALID_PARAMS = -32602,
+ // RPC_INTERNAL_ERROR should only be used for genuine errors in bitcoind
+ // (for exampled datadir corruption).
RPC_INTERNAL_ERROR = -32603,
RPC_PARSE_ERROR = -32700,