summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-05 20:24:39 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-05 20:24:39 +0000
commitd82a47dd0493ee976aa3f15ecdc9aea7da6ad5bf (patch)
tree604109254c7057942fce5c1af26fdd1bc36c066f /src/channel.c
parentbb8cac56d9c398a2b546d9c81c15e8c3d8fd811e (diff)
downloadvim-git-d82a47dd0493ee976aa3f15ecdc9aea7da6ad5bf.tar.gz
patch 8.2.4012: error messages are spread outv8.2.4012
Problem: Error messages are spread out. Solution: Move the last error messages to errors.h.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/channel.c b/src/channel.c
index 3dea7803a..4ab05499a 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -707,8 +707,6 @@ channel_gui_unregister(channel_T *channel)
#endif // FEAT_GUI
-static char *e_cannot_connect = N_("E902: Cannot connect to port");
-
/*
* For Unix we need to call connect() again after connect() failed.
* On Win32 one time is sufficient.
@@ -737,7 +735,7 @@ channel_connect(
if (sd == -1)
{
ch_error(channel, "in socket() in channel_connect().");
- PERROR(_("E898: socket() in channel_connect()"));
+ PERROR(_(e_socket_in_channel_connect));
return -1;
}
@@ -778,7 +776,7 @@ channel_connect(
{
ch_error(channel,
"channel_connect: Connect failed with errno %d", errno);
- PERROR(_(e_cannot_connect));
+ PERROR(_(e_cannot_connect_to_port));
sock_close(sd);
return -1;
}
@@ -824,7 +822,7 @@ channel_connect(
SOCK_ERRNO;
ch_error(channel,
"channel_connect: Connect failed with errno %d", errno);
- PERROR(_(e_cannot_connect));
+ PERROR(_(e_cannot_connect_to_port));
sock_close(sd);
return -1;
}
@@ -863,7 +861,7 @@ channel_connect(
ch_error(channel,
"channel_connect: Connect failed with errno %d",
so_error);
- PERROR(_(e_cannot_connect));
+ PERROR(_(e_cannot_connect_to_port));
sock_close(sd);
return -1;
}
@@ -982,8 +980,7 @@ channel_open(
if ((err = getaddrinfo(hostname, NULL, &hints, &res)) != 0)
{
ch_error(channel, "in getaddrinfo() in channel_open()");
- semsg(_("E901: getaddrinfo() in channel_open(): %s"),
- gai_strerror(err));
+ semsg(_(e_getaddrinfo_in_channel_open_str), gai_strerror(err));
channel_free(channel);
return NULL;
}
@@ -1047,7 +1044,7 @@ channel_open(
if ((host = gethostbyname(hostname)) == NULL)
{
ch_error(channel, "in gethostbyname() in channel_open()");
- PERROR(_("E901: gethostbyname() in channel_open()"));
+ PERROR(_(e_gethostbyname_in_channel_open));
channel_free(channel);
return NULL;
}
@@ -2480,7 +2477,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
{
ch_error(channel, "received command with non-string argument");
if (p_verbose > 2)
- emsg(_("E903: received command with non-string argument"));
+ emsg(_(e_received_command_with_non_string_argument));
return;
}
arg = argv[1].vval.v_string;
@@ -2537,13 +2534,13 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
{
ch_error(channel, "last argument for expr/call must be a number");
if (p_verbose > 2)
- emsg(_("E904: last argument for expr/call must be a number"));
+ emsg(_(e_last_argument_for_expr_call_must_be_number));
}
else if (is_call && argv[2].v_type != VAR_LIST)
{
ch_error(channel, "third argument for call must be a list");
if (p_verbose > 2)
- emsg(_("E904: third argument for call must be a list"));
+ emsg(_(e_third_argument_for_call_must_be_list));
}
else
{
@@ -2600,7 +2597,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
else if (p_verbose > 2)
{
ch_error(channel, "Received unknown command: %s", (char *)cmd);
- semsg(_("E905: received unknown command: %s"), cmd);
+ semsg(_(e_received_unknown_command_str), cmd);
}
}
@@ -3843,7 +3840,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part)
if (check_open && (channel == NULL || (!channel_is_open(channel)
&& !(reading && has_readahead))))
{
- emsg(_("E906: not an open channel"));
+ emsg(_(e_not_an_open_channel));
return NULL;
}
return channel;
@@ -4245,7 +4242,7 @@ send_common(
{
if (eval)
{
- semsg(_("E917: Cannot use a callback with %s()"), fun);
+ semsg(_(e_cannot_use_callback_with_str), fun);
return NULL;
}
channel_set_req_callback(channel, *part_read, &opt->jo_callback, id);
@@ -4290,7 +4287,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
ch_mode = channel_get_mode(channel, part_send);
if (ch_mode == MODE_RAW || ch_mode == MODE_NL)
{
- emsg(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel"));
+ emsg(_(e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel));
return;
}