mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
28 lines
526 B
C
28 lines
526 B
C
#include "jsonrpc/error.h"
|
|
|
|
json_t *
|
|
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
|
|
jsonrpc_propate_error(
|
|
jsonrpc_proxy_finished_fn * finised,
|
|
void * user_data,
|
|
int code,
|
|
char const * message)
|
|
{
|
|
json_t * error = jsonrpc_error(code, message);
|
|
finised(user_data, NULL, error);
|
|
|
|
json_decref(error);
|
|
}
|
|
|