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

28 lines
546 B
C
Raw Normal View History

2020-02-29 01:32:03 +00:00
#include "jsonrpc/impl/error.h"
json_t *
2020-02-29 01:32:03 +00:00
jsonrpc_impl_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
2020-02-29 01:32:03 +00:00
jsonrpc_impl_propate_error(
jsonrpc_proxy_finished_fn * finised,
void * user_data,
int code,
char const * message)
{
2020-02-29 01:32:03 +00:00
json_t * error = jsonrpc_impl_error(code, message);
finised(user_data, NULL, error);
json_decref(error);
}