jsonrpc_errors.h: Header for JSON-RPC errors.

This commit is contained in:
ZmnSCPxj
2018-02-05 01:19:16 +00:00
committed by Christian Decker
parent b3534462e0
commit 6d789282c9
3 changed files with 16 additions and 5 deletions

View File

@@ -78,7 +78,8 @@ ALL_OBJS += $(LIGHTNINGD_OBJS)
# We accumulate all lightningd/ headers in these three:
LIGHTNINGD_HEADERS_NOGEN = \
$(LIGHTNINGD_SRC:.c=.h) \
lightningd/peer_state.h
lightningd/peer_state.h \
lightningd/jsonrpc_errors.h
# Generated headers
LIGHTNINGD_HEADERS_GEN = \

View File

@@ -14,6 +14,7 @@
#include <fcntl.h>
#include <lightningd/chaintopology.h>
#include <lightningd/jsonrpc.h>
#include <lightningd/jsonrpc_errors.h>
#include <lightningd/lightningd.h>
#include <lightningd/log.h>
#include <lightningd/options.h>
@@ -470,10 +471,6 @@ void json_add_address(struct json_result *response, const char *fieldname,
json_object_end(response);
}
#define JSONRPC2_INVALID_REQUEST -32600
#define JSONRPC2_METHOD_NOT_FOUND -32601
#define JSONRPC2_INVALID_PARAMS -32602
void command_success(struct command *cmd, struct json_result *result)
{
struct json_connection *jcon = cmd->jcon;

View File

@@ -0,0 +1,13 @@
/* lightningd/jsonrpc_errors.h
* Lists error codes for JSON-RPC.
*/
#ifndef LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H
#define LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H
#include "config.h"
/* Standad errors defined by JSON-RPC 2.0 standard */
#define JSONRPC2_INVALID_REQUEST -32600
#define JSONRPC2_METHOD_NOT_FOUND -32601
#define JSONRPC2_INVALID_PARAMS -32602
#endif /* !defined (LIGHTNING_LIGHTNINGD_JSONRPC_ERRORS_H) */