msgpack-rpc: handle failure to convert method arguments #2664

This commit is contained in:
Björn Linse
2015-05-15 16:01:53 +02:00
parent 90fae3663f
commit 5bbd182a3e
2 changed files with 16 additions and 1 deletions

View File

@@ -306,6 +306,17 @@ Object msgpack_rpc_handle_missing_method(uint64_t channel_id,
return NIL;
}
/// Handler executed when malformated arguments are passed
Object msgpack_rpc_handle_invalid_arguments(uint64_t channel_id,
uint64_t request_id,
Array args,
Error *error)
{
snprintf(error->msg, sizeof(error->msg), "Invalid method arguments");
error->set = true;
return NIL;
}
/// Serializes a msgpack-rpc request or notification(id == 0)
void msgpack_rpc_serialize_request(uint64_t request_id,
String method,