Browse Source

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.
0.15
John Newbery 8 years ago
parent
commit
338bf065a4
  1. 6
      src/rpc/protocol.h

6
src/rpc/protocol.h

@ -31,9 +31,15 @@ enum HTTPStatusCode
enum RPCErrorCode enum RPCErrorCode
{ {
//! Standard JSON-RPC 2.0 errors //! 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_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_METHOD_NOT_FOUND = -32601,
RPC_INVALID_PARAMS = -32602, 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_INTERNAL_ERROR = -32603,
RPC_PARSE_ERROR = -32700, RPC_PARSE_ERROR = -32700,

Loading…
Cancel
Save