summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorAlisue <lambdalisue@hashnote.net>2021-06-30 22:01:02 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-30 22:01:02 +0200
commit11a632d60bde616feb298d180108819ebb1d04a0 (patch)
tree92e1b48363ca1e75832540be27ceb0fe8fd9389f /src/channel.c
parent576cb75ceb38ed077938d4a1c1265095050f6105 (diff)
downloadvim-git-11a632d60bde616feb298d180108819ebb1d04a0.tar.gz
patch 8.2.3081: cannot catch errors in a channel commandv8.2.3081
Problem: Cannot catch errors in a channel command. Solution: Instead of skipping the error make it silent. (closes #8477)
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index 5818dc399..5d8941350 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2545,7 +2545,8 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
char_u *json = NULL;
// Don't pollute the display with errors.
- ++emsg_skip;
+ // Do generate the errors so that try/catch works.
+ ++emsg_silent;
if (!is_call)
{
ch_log(channel, "Evaluating expression '%s'", (char *)arg);
@@ -2581,7 +2582,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
vim_free(json);
}
}
- --emsg_skip;
+ --emsg_silent;
if (tv == &res_tv)
clear_tv(tv);
else