1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/webfuse/impl/jsonrpc/error.c
2020-06-28 19:43:08 +02:00

28 lines
566 B
C

#include "webfuse/impl/jsonrpc/error.h"
json_t *
wf_impl_jsonrpc_error(
int code,
char const * message)
{
json_t * error = json_object();
json_object_set_new(error, "code", json_integer(code));
json_object_set_new(error, "message", json_string(message));
return error;
}
void
wf_impl_jsonrpc_propate_error(
wf_jsonrpc_proxy_finished_fn * finised,
void * user_data,
int code,
char const * message)
{
json_t * error = wf_impl_jsonrpc_error(code, message);
finised(user_data, NULL, error);
json_decref(error);
}