diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-07-15 19:55:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-15 19:55:53 +0200 |
commit | dfe79b67a5621ebd779a40a87a85304ffd89a5af (patch) | |
tree | fc6d5d8082429faec13207bc11f2acb7d9b25c6b /src/nvim/api/vim.c | |
parent | c230ef24a2b5bcd21902ca7fd89ff9ecd455638f (diff) | |
parent | 099718ae6d57239164d4348e6c7576edf7a2ebb7 (diff) | |
download | rneovim-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.c | 11 |
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); |