aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-07-15 19:55:53 +0200
committerGitHub <noreply@github.com>2018-07-15 19:55:53 +0200
commitdfe79b67a5621ebd779a40a87a85304ffd89a5af (patch)
treefc6d5d8082429faec13207bc11f2acb7d9b25c6b /src/nvim/api/vim.c
parentc230ef24a2b5bcd21902ca7fd89ff9ecd455638f (diff)
parent099718ae6d57239164d4348e6c7576edf7a2ebb7 (diff)
downloadrneovim-dfe79b67a5621ebd779a40a87a85304ffd89a5af.tar.gz
rneovim-dfe79b67a5621ebd779a40a87a85304ffd89a5af.tar.bz2
rneovim-dfe79b67a5621ebd779a40a87a85304ffd89a5af.zip
Merge pull request #8651 from MichaHoffmann/feature_refactor_channel
channel.c: refactor spaghetti code
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 002d9da781..03567ddfd8 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1162,11 +1162,12 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err)
}
Array args = call.items[1].data.array;
- MsgpackRpcRequestHandler handler = msgpack_rpc_get_handler_for(name.data,
- name.size);
- if (handler.fn == msgpack_rpc_handle_missing_method) {
- api_set_error(&nested_error, kErrorTypeException, "Invalid method: %s",
- name.size > 0 ? name.data : "<empty>");
+ MsgpackRpcRequestHandler handler =
+ msgpack_rpc_get_handler_for(name.data,
+ name.size,
+ &nested_error);
+
+ if (ERROR_SET(&nested_error)) {
break;
}
Object result = handler.fn(channel_id, args, &nested_error);