diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-04-08 03:01:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 03:01:15 +0200 |
commit | fa6415f13f526220237cff6c6f0055aaad2cdd9e (patch) | |
tree | c1d90c7903dd5a4b7ae45b3a3cca852c9ab6b26a /src/nvim/api/ui.c | |
parent | 929a732d006ddd2bac49cf5e555e9e83372a511d (diff) | |
download | rneovim-fa6415f13f526220237cff6c6f0055aaad2cdd9e.tar.gz rneovim-fa6415f13f526220237cff6c6f0055aaad2cdd9e.tar.bz2 rneovim-fa6415f13f526220237cff6c6f0055aaad2cdd9e.zip |
test/API: validate channel arg (#8245)
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 4870c3fb8a..e39617be7b 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -56,7 +56,8 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, "UI already attached for channel"); + api_set_error(err, kErrorTypeException, + "UI already attached to channel: %" PRId64, channel_id); return; } @@ -130,7 +131,8 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, "UI is not attached for channel"); + api_set_error(err, kErrorTypeException, + "UI not attached to channel: %" PRId64, channel_id); return; } remote_ui_disconnect(channel_id); @@ -142,7 +144,8 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, "UI is not attached for channel"); + api_set_error(err, kErrorTypeException, + "UI not attached to channel: %" PRId64, channel_id); return; } @@ -163,7 +166,8 @@ void nvim_ui_set_option(uint64_t channel_id, String name, FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(error, kErrorTypeException, "UI is not attached for channel"); + api_set_error(error, kErrorTypeException, + "UI not attached to channel: %" PRId64, channel_id); return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); @@ -209,7 +213,7 @@ static void ui_set_option(UI *ui, String name, Object value, Error *error) return; } - api_set_error(error, kErrorTypeValidation, "No such ui option"); + api_set_error(error, kErrorTypeValidation, "No such UI option"); #undef UI_EXT_OPTION } |